Residual coding method and device for same

ABSTRACT

A method for decoding a picture performed by a decoding apparatus according to the present disclosure includes receiving a bitstream including residual information, deriving a quantized transform coefficient for a current block based on the residual information included in the bitstream, deriving a transform coefficient from the quantized transform coefficient based on a dequantization process, deriving a residual sample for the current block by applying an inverse transform to the derived transform coefficient, and generating a reconstructed picture based on the residual sample for the current block.

CROSS-REFERENCE TO RELATED APPLICATIONS

Pursuant to 35 U.S.C. § 119(e), this application is a continuation ofInternational Application PCT/KR2019/011195, with an internationalfiling date of Aug. 30, 2019, which claims the benefit of U.S.Provisional Application Nos. 62/729,979 filed on Sep. 11, 2018, and62/735,211 filed on Sep. 24, 2018, the contents of which are all herebyincorporated by reference herein in their entirety.

BACKGROUND OF THE DISCLOSURE Field of the Disclosure

The present disclosure relates to an image coding technology, and moreparticularly, to a residual coding method in an image coding system anda device thereof.

Related Art

Recently, the demand for high resolution, high quality image/video suchas 4K or 8K Ultra High Definition (UHD) image/video is increasing invarious fields. As the image/video resolution or quality becomes higher,relatively more amount of information or bits are transmitted than forconventional image/video data. Therefore, if image/video data aretransmitted via a medium such as an existing wired/wireless broadbandline or stored in a legacy storage medium, costs for transmission andstorage are readily increased.

Moreover, interests and demand are growing for virtual reality (VR) andartificial reality (AR) contents, and immersive media such as hologram;and broadcasting of images/videos exhibiting image/video characteristicsdifferent from those of an actual image/video, such as gameimages/videos, are also growing.

Therefore, a highly efficient image/video compaction technique isrequired to effectively compress and transmit, store, or play highresolution, high quality images/videos showing various characteristicsas described above.

SUMMARY

An object of the present disclosure is to provide a method and a devicefor enhancing image coding efficiency.

Another object of the present disclosure is to provide a method and adevice for enhancing the efficiency of residual coding.

Still another object of the present disclosure is to provide a methodand a device for enhancing residual coding efficiency by performing abinarization process on residual information based on a rice parameter.

Yet another object of the present disclosure is to provide a method anda device for performing residual coding by setting the maximum value ofthe rice parameter as 3.

Still yet another object of the present disclosure is to provide amethod and a device for performing an initialization process to deriveat least one rice parameter for a sub-block included in a current block.

An embodiment of the present disclosure provides a method for decodingan image performed by a decoding apparatus. The method includesreceiving a bitstream including residual information, deriving aquantized transform coefficient for a current block based on theresidual information included in the bitstream, deriving a transformcoefficient from the quantized transform coefficient based on adequantization process, deriving a residual sample for the current blockby applying an inverse transform to the derived transform coefficient,and generating a reconstructed picture based on the residual sample forthe current block, and the residual information includes transformcoefficient level information, the deriving of the quantized transformcoefficient includes performing a binarization process for the transformcoefficient level information based on a rice parameter, deriving avalue of the transform coefficient level information based on the resultof the binarization process, and deriving the quantized transformcoefficient based on the value of the transform coefficient levelinformation, and the maximum value of the rice parameter is 3.

Another embodiment of the present disclosure provides a decodingapparatus for performing image decoding. The decoding apparatus includesan entropy decoder which receives a bitstream including residualinformation, and derives a quantized transform coefficient for a currentblock based on the residual information included in the bitstream, adequantizer which derives a transform coefficient from the quantizedtransform coefficient based on a dequantization process, an inversetransformer which derives a residual sample for the current block byapplying an inverse transform to the derived transform coefficient, andan adder which generates a reconstructed picture based on the residualsample for the current block, and the residual information includestransform coefficient level information, the entropy decoder performs abinarization process for the transform coefficient level informationbased on a rice parameter, derives a value of the transform coefficientlevel information based on the result of the binarization process, andderives the quantized transform coefficient based on the value of thetransform coefficient level information, and the maximum value of therice parameter is 3.

Still another embodiment of the present disclosure provides a method forencoding an image performed by an encoding apparatus. The methodincludes deriving a residual sample for a current block, deriving atransform coefficient by transforming the residual sample for thecurrent block, deriving a quantized transform coefficient from thetransform coefficient based on a quantization process, and encodingresidual information including information for the quantized transformcoefficient, and the residual information includes transform coefficientlevel information, the encoding of the residual information includesderiving a binarization value of the transform coefficient levelinformation by performing the binarization process for the transformcoefficient level information based on a rice parameter and encoding thebinarization value of the transform coefficient level information, andthe maximum value of the rice parameter is 3.

Yet another embodiment of the present disclosure provides an encodingapparatus for performing image encoding. The encoding apparatus includesa subtractor which derives a residual sample for a current block, atransformer which derives a transform coefficient by transforming theresidual sample for the current block, a quantizer which derives aquantized transform coefficient from the transform coefficient based ona quantization process, and an entropy encoder which encodes residualinformation including information about the quantized transformcoefficient, and the residual information includes transform coefficientlevel information, the entropy encoder derives a binarization value ofthe transform coefficient level information by performing a binarizationprocess for the transform coefficient level information based on a riceparameter, and encodes the binarization value of the transformcoefficient level information, and the maximum value of the riceparameter is 3.

According to the present disclosure, it is possible to enhance theoverall image/video compaction efficiency.

According to the present disclosure, it is possible to enhance theefficiency of the residual coding.

According to the present disclosure, it is possible to enhance theresidual coding efficiency by performing the binarization process on theresidual information based on the rice parameters.

According to the present disclosure, it is possible to efficientlyperform the residual coding by setting the maximum value of the riceparameter as 3.

According to the present disclosure, it is possible to perform theinitialization process to derive at least one rice parameter for thesub-block included in the current block.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram schematically illustrating an example of avideo/image coding system to which the present disclosure may beapplied.

FIG. 2 is a diagram schematically explaining a configuration of avideo/image encoding apparatus to which the present disclosure may beapplied.

FIG. 3 is a diagram schematically explaining a configuration of avideo/image decoding apparatus to which the present disclosure may beapplied.

FIG. 4 is a diagram for explaining an example of deriving a riceparameter for a current transform coefficient based on neighboringreference transform coefficients according to an embodiment.

FIGS. 5A to 5C are diagrams for explaining another example of deriving arice parameter for a current transform coefficient based on neighboringreference transform coefficients according to some embodiments.

FIGS. 6A to 6C are diagrams for explaining still another example ofderiving a rice parameter for a current transform coefficient based onneighboring reference transform coefficients according to another someembodiments.

FIG. 7 is a diagram illustrating a process of deriving quantizedcoefficients of a 2×2 block according to an embodiment.

FIGS. 8A and 8B are diagrams illustrating a configuration and anoperation method of an entropy encoder according to an embodiment.

FIGS. 9A and 9B are diagrams illustrating a configuration and anoperation method of an entropy decoder according to an embodiment.

FIG. 10 is a flowchart illustrating an entropy encoding method of anencoding apparatus according to an embodiment.

FIG. 11 is a flowchart illustrating an entropy decoding method of adecoding apparatus according to an embodiment.

FIG. 12 is a flowchart illustrating an operation of the encodingapparatus according to an embodiment.

FIG. 13 is a block diagram illustrating a configuration of the encodingapparatus according to an embodiment.

FIG. 14 is a flowchart illustrating an operation of the decodingapparatus according to an embodiment.

FIG. 15 is a block diagram illustrating a configuration of the decodingapparatus according to an embodiment.

FIG. 16 is a diagram illustrating an example of a content streamingsystem to which the disclosure disclosed in the present document may beapplied.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

An embodiment of the present disclosure provides a method for decodingan image performed by a decoding apparatus. The method includesreceiving a bitstream including residual information, deriving aquantized transform coefficient for a current block based on theresidual information comprised in the bitstream, deriving a transformcoefficient from the quantized transform coefficient based on adequantization process, deriving a residual sample for the current blockby applying an inverse transform to the derived transform coefficient,and generating a reconstructed picture based on the residual sample forthe current block, and the residual information comprises transformcoefficient level information, the deriving of the quantized transformcoefficient includes performing a binarization process for the transformcoefficient level information based on a rice parameter, deriving avalue of the transform coefficient level information based on the resultof the binarization process, and deriving the quantized transformcoefficient based on the value of the transform coefficient levelinformation, and the maximum value of the rice parameter is 3.

The present disclosure may be changed variously and may have variousembodiments, and specific embodiments thereof will be described indetail and illustrated in the drawings. However, this does not limit thepresent disclosure to specific embodiments. The terms used in thepresent specification are used to merely describe specific embodimentsand are not intended to limit the technical spirit of the presentdisclosure. An expression of a singular number includes an expression ofthe plural number, so long as it is clearly read on the contextdifferently. The terms such as “include” and “have” in the presentspecification are intended to represent that features, numbers, steps,operations, components, parts, or combinations thereof used in thespecification exist, and it should be understood that the possibility ofexistence or addition of one or more different features, numbers, steps,operations, components, parts, or combinations thereof is not excludedin advance.

Meanwhile, each of the components in the drawings described in thepresent disclosure is illustrated independently for the convenience ofdescription regarding different characteristic functions, and does notmean that each of the components is implemented in separate hardware orseparate software. For example, two or more of the components may becombined to form one component, or one component may be divided into aplurality of components. Embodiments in which each component isintegrated and/or separated are also included in the scope of thepresent disclosure without departing from the spirit of the presentdisclosure.

Hereinafter, preferred embodiments of the present disclosure will bedescribed in more detail with reference to the accompanying drawings.Hereinafter, the same reference numerals are used for the samecomponents in the drawings, and redundant description of the samecomponents may be omitted.

FIG. 1 illustrates an example of a video/image coding system to whichthe present disclosure may be applied.

Referring to FIG. 1 , a video/image coding system may include a firstapparatus (source device) and a second apparatus (reception device). Thesource device may transmit encoded video/image information or data tothe reception device through a digital storage medium or network in theform of a file or streaming.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compaction and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

This document relates to video/image coding. For example, themethods/embodiments disclosed in this document may be applied to amethod which is disclosed in a versatile video coding (VVC) standard, anessential video coding (EVC) standard, an AOMedia Video 1 (AV1)standard, a 2nd generation of audio video coding standard (AVS2), or anext generation video/image coding standard (for example, 11.267,11.268, or the like).

This document suggests various embodiments of video/image coding, andthe above embodiments may also be performed in combination with eachother unless otherwise specified.

In this document, a video may refer to a series of images over time. Apicture generally refers to the unit representing one image at aparticular time frame, and a slice/tile refers to the unit constitutingthe picture in terms of coding. A slice/tile may include one or morecoding tree units (CTUs). One picture may consist of one or moreslices/tiles. One picture may consist of one or more tile groups. Onetile group may include one or more tiles. A brick may represent arectangular region of CTU rows within a tile in a picture. A tile may bepartitioned into multiple bricks, each of which consisting of one ormore CTU rows within the tile. A tile that is not partitioned intomultiple bricks may be also referred to as a brick. A brick scan is aspecific sequential ordering of CTUs partitioning a picture in which theCTUs are ordered consecutively in CTU raster scan in a brick, brickswithin a tile are ordered consecutively in a raster scan of the bricksof the tile, and tiles in a picture are ordered consecutively in araster scan of the tiles of the picture. A tile is a rectangular regionof CTUs within a particular tile column and a particular tile row in apicture. The tile column is a rectangular region of CTUs having a heightequal to the height of the picture and a width specified by syntaxelements in the picture parameter set. The tile row is a rectangularregion of CTUs having a height specified by syntax elements in thepicture parameter set and a width equal to the width of the picture. Atile scan is a specified sequential ordering of CTUs partitioning apicture in which the CTUs are ordered consecutively in CTU raster scanin a tile whereas tiles in a picture are ordered consecutively in araster scan of the tiles of the picture. A slice includes an integernumber of bricks of a picture that may be exclusively contained in asingle NAL unit. A slice may consist of either a number of completetiles or only a consecutive sequence of complete bricks of one tile. Inthis document, a tile group and a slice may be used interchangeably. Forexample, in this document, a tile group/tile group header may also bereferred to as a slice/slice header.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows.

In this document, the term “/” and “,” should be interpreted to indicate“and/or.” For instance, the expression “A/B” may mean “A and/or B.”Further, “A, B” may mean “A and/or B.” Further, “A/B/C” may mean “atleast one of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A,B, and/or C.”

Further, in the document, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in this document should be interpreted to indicate “additionally oralternatively.”

FIG. 2 illustrates a structure of a video/image encoding apparatus towhich the present disclosure may be applied. In what follows, a videoencoding apparatus may include an image encoding apparatus.

Referring to FIG. 2 , the encoding apparatus 200 includes an imagepartitioner 210, a predictor 220, a residual processor 230, and anentropy encoder 240, an adder 250, a filter 260, and a memory 270. Thepredictor 220 may include an inter predictor 221 and an intra predictor222. The residual processor 230 may include a transformer 232, aquantizer 233, a dequantizer 234, and an inverse transformer 235. Theresidual processor 230 may further include a subtractor 231. The adder250 may be called a reconstructor or a reconstructed block generator.The image partitioner 210, the predictor 220, the residual processor230, the entropy encoder 240, the adder 250, and the filter 260 may beconfigured by at least one hardware component (ex. an encoder chipset orprocessor) according to an embodiment. Further, the memory 270 mayinclude a decoded picture buffer (DPB) or may be configured by a digitalstorage medium. The hardware component may further include the memory270 as an internal/external component.

The image partitioner 210 may partition an input image (or a picture ora frame) input to the encoding apparatus 200 into one or moreprocessors. For example, the processor may be called a coding unit (CU).In this case, the coding unit may be recursively partitioned accordingto a quad-tree binary-tree ternary-tree (QTBTTT) structure from a codingtree unit (CTU) or a largest coding unit (LCU). For example, one codingunit may be partitioned into a plurality of coding units of a deeperdepth based on a quad tree structure, a binary tree structure, and/or aternary structure. In this case, for example, the quad tree structuremay be applied first and the binary tree structure and/or ternarystructure may be applied later. Alternatively, the binary tree structuremay be applied first. The coding procedure according to the presentdisclosure may be performed based on the final coding unit that is nolonger partitioned. In this case, the largest coding unit may be used asthe final coding unit based on coding efficiency according to imagecharacteristics, or if necessary, the coding unit may be recursivelypartitioned into coding units of deeper depth and a coding unit havingan optimal size may be used as the final coding unit. Here, the codingprocedure may include a procedure of prediction, transform, andreconstruction, which will be described later. As another example, theprocessor may further include a prediction unit (PU) or a transform unit(TU). In this case, the prediction unit and the transform unit may besplit or partitioned from the aforementioned final coding unit. Theprediction unit may be a unit of sample prediction, and the transformunit may be a unit for deriving a transform coefficient and/or a unitfor deriving a residual signal from the transform coefficient.

The unit may be used interchangeably with terms such as block or area insome cases. In a general case, an M×N block may represent a set ofsamples or transform coefficients composed of M columns and N rows. Asample may generally represent a pixel or a value of a pixel, mayrepresent only a pixel/pixel value of a luma component or represent onlya pixel/pixel value of a chroma component. A sample may be used as aterm corresponding to one picture (or image) for a pixel or a pel.

In the encoding apparatus 200, a prediction signal (predicted block,prediction sample array) output from the inter predictor 221 or theintra predictor 222 is subtracted from an input image signal (originalblock, original sample array) to generate a residual signal residualblock, residual sample array), and the generated residual signal istransmitted to the transformer 232. In this case, as shown, a unit forsubtracting a prediction signal (predicted block, prediction samplearray) from the input image signal (original block, original samplearray) in the encoder 200 may be called a subtractor 231. The predictormay perform prediction on a block to be processed (hereinafter, referredto as a current block) and generate a predicted block includingprediction samples for the current block. The predictor may determinewhether intra prediction or inter prediction is applied on a currentblock or CU basis. As described later in the description of eachprediction mode, the predictor may generate various information relatedto prediction, such as prediction mode information, and transmit thegenerated information to the entropy encoder 240. The information on theprediction may be encoded in the entropy encoder 240 and output in theform of a bitstream.

The intra predictor 222 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The non-directional mode may include, for example,a DC mode and a planar mode. The directional mode may include, forexample, 33 directional prediction modes or 65 directional predictionmodes according to the degree of detail of the prediction direction.However, this is merely an example, more or less directional predictionmodes may be used depending on a setting. The intra predictor 222 maydetermine the prediction mode applied to the current block by using aprediction mode applied to a neighboring block.

The inter predictor 221 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. Here, in order to reduce theamount of motion information transmitted in the inter prediction mode,the motion information may be predicted in units of blocks, sub-blocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. The referencepicture including the reference block and the reference pictureincluding the temporal neighboring block may be the same or different.The temporal neighboring block may be called a collocated referenceblock, a co-located CU (colCU), and the like, and the reference pictureincluding the temporal neighboring block may be called a collocatedpicture (colPic). For example, the inter predictor 221 may configure amotion information candidate list based on neighboring blocks andgenerate information representing which candidate is used to derive amotion vector and/or a reference picture index of the current block.Inter prediction may be performed based on various prediction modes. Forexample, in the case of a skip mode and a merge mode, the interpredictor 221 may use motion information of the neighboring block asmotion information of the current block. In the skip mode, unlike themerge mode, the residual signal may not be transmitted. In the case ofthe motion vector prediction (MVP) mode, the motion vector of theneighboring block may be used as a motion vector predictor and themotion vector of the current block may be indicated by signaling amotion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply both intra prediction and inter prediction.This may be called combined inter and intra prediction (01P). Further,the predictor may be based on an intra block copy (IBC) prediction modeor a palette mode for prediction of a block. The IBC prediction mode orpalette mode may be used for content image/video coding of a game or thelike, for example, screen content coding (SCC). The IBC basicallyperforms prediction in the current picture but may be performedsimilarly to inter prediction in that a reference block is derived inthe current picture. That is, the IBC may use at least one of the interprediction techniques described in this document. The palette mode maybe considered as an example of intra coding or intra prediction. Whenthe palette mode is applied, a sample value within a picture may besignaled based on information on the palette table and the paletteindex.

The prediction signal generated by the predictor (including the interpredictor 221 and/or the intra predictor 222) may be used to generate areconstructed signal or to generate a residual signal. The transformer232 may generate transform coefficients by applying a transformtechnique to the residual signal. For example, the transform techniquemay include at least one of a discrete cosine transform (DCT), adiscrete sine transform (DST), a Karhunen—Loève Transform (KLT), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, the GBT means transform obtained from a graph whenrelationship information between pixels is represented by the graph. TheCNT refers to transform generated based on a prediction signal generatedusing all previously reconstructed pixels. Further, the transformprocess may be applied to square pixel blocks having the same size ormay be applied to blocks having a variable size rather than square.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240 and the entropy encoder 240 may encodethe quantized signal (information on the quantized transformcoefficients) and output a bitstream. The information on the quantizedtransform coefficients may be referred to as residual information. Thequantizer 233 may rearrange block type quantized transform coefficientsinto a one-dimensional vector form based on a coefficient scanning orderand generate information on the quantized transform coefficients basedon the quantized transform coefficients in the one-dimensional vectorform. Information on transform coefficients may be generated. Theentropy encoder 240 may perform various encoding methods such as, forexample, exponential Golomb, context-adaptive variable length coding(CAVLC), context-adaptive binary arithmetic coding (CABAC), and thelike. The entropy encoder 240 may encode information necessary forvideo/image reconstruction other tha quantized transform coefficients(ex. values of syntax elements, etc.) together or separately. Encodedinformation (ex. encoded video/image information) may be transmitted orstored in units of NALs (network abstraction layer) in the form of abitstream. The video/image information may further include informationon various parameter sets such as an adaptation parameter set (APS), apicture parameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). Further, the video/image information may furtherinclude general constraint information. In this document, informationand/or syntax elements transmitted/signaled from the encoding apparatusto the decoding apparatus may be included in video/picture information.The video/image information may be encoded through the above-describedencoding procedure and included in the bitstream. The bitstream may betransmitted over a network or may be stored in a digital storage medium.The network may include a broadcasting network and/or a communicationnetwork, and the digital storage medium may include various storagemedia such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. Atransmitter (not shown) transmitting a signal output from the entropyencoder 240 and/or a storage unit (not shown) storing the signal may beincluded as internal/external element of the encoding apparatus 200, andalternatively, the transmitter may be included in the entropy encoder240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transformer235. The adder 250 adds the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). If there is noresidual for the block to be processed, such as a case where the skipmode is applied, the predicted block may be used as the reconstructedblock. The adder 250 may be called a reconstructor or a reconstructedblock generator. The generated reconstructed signal may be used forintra prediction of a next block to be processed in the current pictureand may be used for inter prediction of a next picture through filteringas described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringpicture encoding and/or reconstruction.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 270, specifically, a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variousinformation related to the filtering and transmit the generatedinformation to the entropy encoder 240 as described later in thedescription of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as the reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatusmay be avoided and encoding efficiency may be improved.

The DPB of the memory 270 DPB may store the modified reconstructedpicture for use as a reference picture in the inter predictor 221. Thememory 270 may store the motion information of the block from which themotion information in the current picture is derived (or encoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 221 and used as the motion information of thespatial neighboring block or the motion information of the temporalneighboring block. The memory 270 may store reconstructed samples ofreconstructed blocks in the current picture and may transfer thereconstructed samples to the intra predictor 222.

FIG. 3 illustrates a structure of a video/image decoding apparatus towhich the present disclosure may be applied.

Referring to FIG. 3 , the decoding apparatus 300 may include an entropydecoder 310, a residual processor 320, a predictor 330, an adder 340, afilter 350, a memory 360. The predictor 330 may include an interpredictor 331 and an intra predictor 332. The residual processor 320 mayinclude a dequantizer 321 and an inverse transformer 321. The entropydecoder 310, the residual processor 320, the predictor 330, the adder340, and the filter 350 may be configured by a hardware component (ex. adecoder chipset or a processor) according to an embodiment. Further, thememory 360 may include a decoded picture buffer (DPB) or may beconfigured by a digital storage medium. The hardware component mayfurther include the memory 360 as an internal/external component.

When a bitstream including video/image information is input, thedecoding apparatus 300 may reconstruct an image corresponding to aprocess in which the video/image information is processed in theencoding apparatus of FIG. 2 . For example, the decoding apparatus 300may derive units/blocks based on block partition related informationobtained from the bitstream. The decoding apparatus 300 may performdecoding using a processor applied in the encoding apparatus. Thus, theprocessor of decoding may be a coding unit, for example, and the codingunit may be partitioned according to a quad tree structure, binary treestructure and/or ternary tree structure from the coding tree unit or thelargest coding unit. One or more transform units may be derived from thecoding unit. The reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (ex.video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). Further, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthis document may be decoded may decode the decoding procedure andobtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, CAVLC, or CABAC, and output syntaxelements required for image reconstruction and quantized values oftransform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (the interpredictor 332 and the intra predictor 331), and the residual value onwhich the entropy decoding was performed in the entropy decoder 310,that is, the quantized transform coefficients and related parameterinformation, may be input to the residual processor 320. The residualprocessor 320 may derive the residual signal (the residual block, theresidual samples, the residual sample array). Further, information onfiltering among information decoded by the entropy decoder 310 may beprovided to the filter 350. Meanwhile, a receiver (not shown) forreceiving a signal output from the encoding apparatus may be furtherconfigured as an internal/external element of the decoding apparatus300, or the receiver may be a component of the entropy decoder 310.Meanwhile, the decoding apparatus according to this document may bereferred to as a video/image/picture decoding apparatus, and thedecoding apparatus may be classified into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, the inter predictor 332, and theintra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsand output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock form. In this case, the rearrangement may be performed based onthe coefficient scanning order performed in the encoding apparatus. Thedequantizer 321 may perform dequantization on the quantized transformcoefficients by using a quantization parameter (ex. quantization stepsize information) and obtain transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to obtain a residual signal (residual block, residualsample array).

The predictor may perform prediction on the current block and generate apredicted block including prediction samples for the current block. Thepredictor may determine whether intra prediction or inter prediction isapplied to the current block based on the information on the predictionoutput from the entropy decoder 310 and may determine a specificintra/inter prediction mode.

The predictor 320 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). Further, thepredictor may be based on an intra block copy (IBC) prediction mode or apalette mode for prediction of a block. The IBC prediction mode orpalette mode may be used for content image/video coding of a game or thelike, for example, screen content coding (SCC). The IBC basicallyperforms prediction in the current picture but may be performedsimilarly to inter prediction in that a reference block is derived inthe current picture. That is, the IBC may use at least one of the interprediction techniques described in this document. The palette mode maybe considered as an example of intra coding or intra prediction. Whenthe palette mode is applied, a sample value within a picture may besignaled based on information on the palette table and the paletteindex.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The intra predictor 331 may determine theprediction mode applied to the current block by using a prediction modeapplied to a neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information transmitted in the inter predictionmode, motion information may be predicted in units of blocks,sub-blocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include inter prediction direction(L0 prediction, L1 prediction, Bi prediction, etc.) information. In thecase of inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. For example, theinter predictor 332 may configure a motion information candidate listbased on neighboring blocks and derive a motion vector of the currentblock and/or a reference picture index based on the received candidateselection information. Inter prediction may be performed based onvarious prediction modes, and the information on the prediction mayinclude information representing a mode of inter prediction for thecurrent block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,predicted sample array) output from the predictor (including the interpredictor 332 and/or the intra predictor 331). If there is no residualfor the block to be processed, such as when the skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of a next block to be processed in the current picture, maybe output through filtering as described below, or may be used for interprediction of a next picture.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in thepicture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 360, specifically, a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 260 so as to be utilized as the motion informationof the spatial neighboring block or the motion information of thetemporal neighboring block. The memory 360 may store reconstructedsamples of reconstructed blocks in the current picture and transfer thereconstructed samples to the intra predictor 331.

In the present disclosure, the embodiments described in the filter 260,the inter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be the same as or respectively applied to correspondto the filter 350, the inter predictor 332, and the intra predictor 331of the decoding apparatus 300. The same may also apply to the unit 332and the intra predictor 331.

As described above, in performing video coding, prediction is performedto enhance compaction efficiency. Accordingly, a predicted blockincluding prediction samples for a current block which is a codingtarget block may be generated. Here, the predicted block includesprediction samples in a spatial domain (or pixel domain). The predictedblock is derived equally from an encoding apparatus and a decodingapparatus, and the encoding apparatus may signal information (residualinformation) about the residual between the original block and thepredicted block rather than the original sample value of the originalblock itself to the decoding apparatus, thereby enhancing image codingefficiency. The decoding apparatus may derive a residual block includingresidual samples based on the residual information, generate areconstructed block including reconstruction samples by summing theresidual block and the predicted block, and generate a reconstructedpicture including the restructured blocks.

The residual information may be generated through transform andquantization procedures. For example, the encoding apparatus may signalrelated residual information to the decoding apparatus (through abitstream) by deriving the residual block between the original block andthe predicted block, deriving transform coefficients by performing thetransform procedure for the residual samples (residual sample array)included in the residual block, and deriving quantized transformcoefficients by performing the quantization procedure for the transformcoefficients. Here, the residual information may include informationsuch as value information, position information, a transform technique,a transform kernel, and quantization parameters of the quantizedtransform coefficients. The decoding apparatus may performdequantization/inverse transform procedures based on the residualinformation and derive the residual samples (or residual blocks). Thedecoding apparatus may generate a reconstructed picture based on thepredicted block and the residual block. The encoding apparatus may alsodequantize/inversely transform the quantized transform coefficients forreference for the inter prediction of the post-picture to derive theresidual block, and generate the reconstructed picture based thereon.

In an embodiment, the (quantized) transform coefficients are encodedand/or decoded based on the syntax elements such as transform_skip_flag,last_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, coded_sub_block_flag,sig_coeff_flag, par_level_flag, rem_abs_gt1_flag, rem_abs_gt2_flag,abs_remainder, coeff_sign_flag, and mts_idx. Table 1 below representsthe syntax elements related to the encoding of the residual data.

TABLE 1 Descriptor residual_coding( x0, y0, log2TbWidth, log2TbHeight,cIdx ) {  if( transform_skip_enabled_flag && ( cIdx ! = 0 | |cu_mts_flag[ x0 ][ y0 ] = = 0 ) &&   (log2TbWidth <= 2 ) && (log2TbHeight <= 2 ) )   transform_skip_flag[ x0 ][ y0 ][ cIdx ] ae(v) last_sig_coeff_x_prefix ae(v)  last_sig_coeff_y_prefix ae(v)  if(last_sig_coeff_x_prefix > 3 )   last_sig_coeff_x_suffix ae(v)  if(last_sig_coeff_y_prefix > 3 )   last_sig_coeff_y_suffix ae(v) log2SbSize = ( Min( log2TbWidth, log2TbHeight ) < 2 ? 1 : 2 ) numSbCoeff = 1 << ( log2SbSize << 1 )  lastScanPos = numSbCoeff lastSub-block = ( 1 << ( log2TbWidth + log2TbHeight − 2 * log2SbSize )) − 1  do {   if( lastScanPos = = 0 ) {    lastScanPos = numSbCoeff   lastSub-block− −   }   lastScanPos− −   xS = DiagScanOrder[log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize ]         [lastSub-block ][ 0 ]   yS = DiagScanOrder[ log2TbWidth − log2SbSize ][log2TbHeight − log2SbSize ]         [ lastSub-block ][ l ]   xC = ( xS<< log2SbSize ) +     DiagScanOrder[ log2SbSize ][ log2SbSize ][lastScanPos ][ 0 ]   yC = ( yS << log2SbSize ) +     DiagScanOrder[log2SbSize ][ log2SbSize ][ lastScanPos ][ 1 ]  } while( ( xC !=LastSignificantCoeffX) | | ( yC != LastSignificantCoeffY ) )  QState = 0 for( i = lastSub-block; i >= 0; i− − ) {   startQStateSb = QState   xS= DiagScanOrder[ log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize ]        [ lastsub-block ][ 0 ]   yS = DiagScanOrder[ log2TbWidth −log2SbSize ][ log2TbHeight − log2SbSize ]         [ lastSub-block ][ 1 ]  inferSbDcSigCoeffFlag = 0   if( (i < lastSub-block ) && ( i > 0 ) ) {   coded_sub_block_flag[ xS ][ yS ] ae(v)    inferSbDcSigCoeffFlag = 1  }   firstSigScanPosSb = numSbCoeff   lastSigScanPosSb = −1   for( n =( i = = lastSub-block ) ? lastScanPos − 1 : numSbCoeff − 1; n >= 0; n− −) {     xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 0 ]     yC = ( yS << log2SbSize ) + DiagScanOrder[log2SbSize ][ log2SbSize ][ n ][ 1 ]     if( coded_sub_block_flag[ xS ][yS ] && ( n > 0 | | !inferSbDcSigCoeffFlag ) ) {      sig_coeff_flag[ xC][ yC ] ae(v)     }   if( sig_coeff_flag[ xC ][ yC ] ) {   par_level_flag[ n ] ae(v)    rem_abs_gt1_flag[ n ] ae(v) if(lastSigScanPosSb = = −1 )     lastSigScanPosSb = n    firstSigScanPosSb= n   }   AbsLevelPass1[ xC ][ yC ] =    sig_coeff_flag[ xC ][ yC ] +par_level_flag[ n ] + 2 * rem_abs_gt1_flag[ n ]   if(dep_quant_enabled_flag )    QState = QStateTransTable[ QState ][par_level_flag[ n ] ]  }  for( n = numSbCoeff − 1; n >= 0; n− − ) {  if( rem_abs_gt1_flag[ n ] )    rem_abs_gt2_flag[ n ] ae(v)  }  for( n= numSbCoeff − 1; n >= 0; n− − ) {   xC = ( xS << log2SbSize ) +DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if(rem_abs_gt2_flag[ n ] )    abs_remainder[ n ]   AbsLevel[ xC ][ yC ] =AbsLevelPass1[ xC ][ yC ] +          2 * ( rem_abs_gt2_flag[ n ] +abs_remainder[ n ] )  }  if( dep_quant_enabled_flag | |!sign_data_hiding_enabled_flag )   signHidden = 0  else   signHidden = (lastSigScanPosSb − firstSigScanPosSb > 3 ? 1 : 0 )  for( n = numSbCoeff− 1; n >= 0; n− − ) {   xC = ( xS << log2SbSize ) + DiagScanOrder[log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS << log2SbSize ) +DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if(sig_coeff_flag[ xC ][ yC ] &&    ( !signHidden | | ( n =firstSigScanPosSb ) ) )    coeff_sign_flag[ n ] ae(v)  }  if(dep_quant_enabled_flag ) {   QState = startQStateSb   for( n =numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS << log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) +     DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( sig_coeff_flag[ xC ] [ yC ] )     TransCoeffLevel[ x0 ][ y0 ][cIdx ][ xC ][ yC ] =     (2* AbsLevel[ xC ][ yC ] − ( QState > 1 ? 1 : 0) ) *     (1 − 2 * coeff_sign_flag[ n ] )    QState = QStateTransTable[QState ][ par_level_flag[ n ] ]  } else {   sumAbsLevel = 0   for( n =numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS << log2SbSize ) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) +     DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( sig_coeff_flag[ xC ] [ yC ] ) {     TransCoeffLevel[ x0 ][ y0 ][cIdx ][ xC ][ yC ] =      AbsLevel[ xC ][ yC ] * ( 1 − 2 *coeff_sign_flag[ n ] )     if( signHidden ) {     sumAbsLevel +=AbsLevel[ xC ][ yC ]     if( ( n = = firstSigScanPosSb ) && (sumAbsLevel % 2 ) = = 1 ) )      TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC][ yC ] =       −TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ]      }    }    }   }  }  if( cu_mts_flag[ x0 ][ y0 ] && ( cIdx = = 0 ) &&  !transform_skip_flag[ x0 ][ y0 ][ cIdx ] &&   ( ( CuPredMode[ x0 ][ y0] = = MODE_INTRA && numSigCoeff > 2 ) | |    ( CuPredMode[ x0 ][ y0 ] == MODE_INTER ) ) ) {   mts_idx[ x0 ][ y0 ] ae(v) }

The transform_skip_flag represents whether transform is omitted in anassociated block. The associated block may be a coding block (CB) or atransform block (TB). With regard to the transform (and quantization)and residual coding procedures, the CB and the TB may be usedinterchangeably. For example, as described above, the residual samplesmay be derived for the CB, and the (quantized) transform coefficientsmay be derived through the transform and the quantization for theresidual samples, and information (for example, syntax elements)efficiently representing the position, size, sign, and the like of the(quantized) transform coefficients may be generated and signaled throughthe residual coding procedure. The quantized transform coefficients maysimply be referred to as transform coefficients. Generally, if the CB isnot larger than the maximum TB, the size of the CB may be equal to thesize of the TB, and in this case, the target block to be transformed(and quantized) and residual coded may be referred to as CB or TB.Meanwhile, if the CB is larger than the maximum TB, the target block tobe transformed (and quantized) and residual coded may be referred to asTB. Hereinafter, although it will be described that the syntax elementsrelated to the residual coding are signaled in units of transform block(TB), this is an example and the TB may be used interchangeably with thecoding block (CB) as described above.

In an embodiment, (x, y) position information of the last non-zerotransform coefficient within the transform block may be encoded based onthe syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. More specifically,the last_sig_coeff_x_prefix represents the prefix of the column positionof the last significant coefficient in the scanning order within thetransform block, the last_sig_coeff_y_prefix represents the prefix ofthe row position of the last significant coefficient in the scanningorder within the transform block, the last_sig_coeff_x_suffix representsthe suffix of the column position of the last significant coefficient inthe scanning order within the transform block, and thelast_sig_coeff_y_suffix represents the suffix of the row position of thelast significant coefficient in the scanning order within the transformblock. Here, the significant coefficient may represent the non-zerocoefficient. The scanning order may be an up-right diagonal scanningorder. Alternatively, the scanning order may be a horizontal scanningorder or a vertical scanning order. The scanning order may be determinedbased on whether intra/inter prediction is applied to the target block(CB, or CB including TB) and/or a specific intra/inter prediction mode.

Subsequently, after the transform block is split into 4×4 sub-blocks, a1-bit syntax element coded_sub_block_flag may be used every 4×4sub-block to represent whether there exists the non-zero coefficientwithin the current sub-block.

If a value of the coded_sub_block_flag is 0, there is no moreinformation to be transmitted, such that the encoding process for thecurrent sub-block may be terminated. Conversely, if the value of thecoded_sub_block_flag is 1, the encoding process for the sig_coeff_flagmay be continuously performed. Since the encoding for thecoded_sub_block_flag is not necessary for the sub-block including thelast non-zero coefficient, and the sub-block including DC information ofthe transform block has a high probability of including the non-zerocoefficient, the coded_sub_block_flag is not encoded and the valuethereof may be assumed to be 1.

If the value of the coded_sub_block_flag is 1 and it is determined thatthe non-zero coefficient exists within the current sub-block, thesig_coeff_flag having a binary value may be encoded according to theinversely scanned order. A 1-bit syntax element sig_coeff_flag may beencoded for each coefficient according to the scanning order. If thevalue of the transform coefficient at the current scanning position isnot 0, the value of the sig_coeff_flag may be 1. Here, in the case ofthe sub-block including the last non-zero coefficient, since it is notnecessary to encode the sig_coeff_flag for the last non-zerocoefficient, the encoding process for the sub-block may be omitted.Level information may be encoded only when the sig_coeff_flag is 1, andfour syntax elements may be used in the level information encodingprocess. More specifically, each sig_coeff_flag [xC] [yC] may representwhether the level (value) of the corresponding transform coefficient ateach transform coefficient position (xC, yC) within the current TB isnon-zero.

The remaining level value after the encoding for the sig_coeff_flag maybe expressed by Equation 1 below. That is, the syntax elementremAbsLevel representing the level value to be encoded may be expressedby Equation 1 below. Here, the coeff means an actual transformcoefficient value.

remAbsLevel=|coeff|−1  Equation 1

As expressed by Equation 2 below, a value of the least significantcoefficient (LSB) of the remAbsLevel expressed by Equation 1 may beencoded through the par_level_flag. Here, the par_level_flag [n] mayrepresent a parity of the transform coefficient level (value) at thescanning position (n). After the par_level_flag is encoded, a transformcoefficient level value remAbsLevel to be encoded may be updated asexpressed by Equation 3 below.

par_level_flag=remAbsLevel&1  Equation 2

remAbsLevel′=remAbsLevel>>1  Equation 3

The rem_abs_gt1_flag may represent whether the remAbsLevel′ at thecorresponding scanning position (n) is larger than 1, and therem_abs_gt2_flag may represent whether the remAbsLevel′ at thecorresponding scanning position (n) is larger than 2. The encoding forthe abs_remainder may be performed only when the rem_abs_gt2_flag is 1.The relationship between the actual transform coefficient value (coeff)and the respective syntax elements is, for example, summarized asexpressed by Equation 4 below, and Table 2 below represents examplesrelated to Equation 4. Further, the sign of each coefficient may beencoded by using a 1-bit symbol coeff_sign_flag. The |coeff| representsthe transform coefficient level (value), and may also be expressed asAbsLevel for the transform coefficient.

|coeff|=sig_coeff_flag+par_level_flag+2*(rem_abs_gt1_flag+rem_abs_gt2_flag+abs_remainder)  Equation4

TABLE 2 sig_coeff_ par_level_ rem_abs_ rem_abs_ abs_ |coeff| flag flaggt1_flag gt2_flag remainder 0 0 1 1 0 0 2 1 1 0 3 1 0 1 0 4 1 1 1 0 5 10 1 1 0 6 1 1 1 1 0 7 1 0 1 1 1 8 1 1 1 1 1 9 1 0 1 1 2 10 1 1 1 1 2 111 0 1 1 3 . . . . . . . . . . . . . . . . . .

Meanwhile, in another embodiment, the rem_abs_gt2_flag may also bereferred to as rem_abs_gt3_flag, and in still another embodiment, therem_abs_gt1_flag and the rem_abs_gt2_flag may also be represented basedon abs_level_gtx_flag [n] [j]. The abs_level_gtx_flag [n] [j] may be aflag representing whether an absolute value of the transform coefficientlevel (or value obtained by shifting the transform coefficient level tothe right by 1) at the scanning position (n) is larger than (j<<1)+1.The rem_abs_gt1_flag may perform the same and/or similar functions asabs_level_gtx_flag [n] [0], and the rem_abs_gt2_flag may perform thesame and/or similar functions as abs_level_gtx_flag [n] [1]. In somecases, the (j<<1)+1 may also be replaced with a predetermined referencevalue such as a first reference value and a second reference value.

The binarization method for each syntax element may be expressed inTable 3 below. In Table 3, a TR means a Truncated Rice binarizationmethod, a FL means a Fixed-Length binarization method, and a detaileddescription of each binarization method will be described later.

TABLE 3 Binarization Syntax element Process Input parameterstransform_skip_ FL cMax = 1 flag[ ][ ][ ] last_sig_coeff_x_ TR cMax =prefix ( log2TrafoSize << 1 ) − 1, cRiceParam = 0 last_sig_coeff_y_ TRcMax = prefix ( log2TrafoSize << 1 ) − 1, cRiceParam = 0last_sig_coeff_x_ FL cMax = ( 1 << suffix ( ( last_sig_coeff_x_prefix >>1 ) − 1 ) − 1 ) last_sig_coeff_y_ FL cMax = ( 1 << suffix ( (last_sig_coeff_y_prefix >> 1 ) − 1 ) − 1 ) coded_sub_block_ FL cMax = 1flag[ ][ ] sig_coeff_flag[ ][ ] FL cMax = 1 par_level_flag[ ] FL cMax =1 rem_abs_gt1_flag[ ] FL cMax = 1 rem_abs_gt2_flag[ ] FL cMax = 1abs_remainder[ ] 2.0.5 cIdx, x0, y0, xC, yC, log2TbWidth, log2TbHeightcoeff_sign_flag[ ] FL cMax = 1 mts_idx[ ][ ] FL cMax = 3

In an embodiment, the Truncated Rice binarization process, a parsingprocess for the 0th Exp-Golomb binarization process, the kth Exp-Golombbinarization process, the Fixed-Length binarization process, thebinarization process for the abs_remainder, the process of deriving riceparameters, and the like may be, for example, implemented according tothe following English specification.

1. Truncated Rice Binarization Process

Input to this process is a request for a truncated Rice (TR)binarization, cMax and cRiceParam.

Output of this process is the TR binarization associating each valuesymbolVal with a corresponding bin string.

A TR bin string is a concatenation of a prefix bin string and, whenpresent, a suffix bin string.

For the derivation of the prefix bin string, the following applies:

-   -   The prefix value of symbolVal, prefixVal, is derived as follows:

prefixVal=symbolVal>>cRiceParam  (1)

-   -   The prefix of the TR bin string is specified as follows:    -   If prefixVal is less than cMax>>cRiceParam, the prefix bin        string is a bit string of length prefixVal+1 indexed by binIdx.        The bins for binIdx less than prefixVal are equal to 1. The bin        with binIdx equal to prefixVal is equal to 0. Table 4        illustrates the bin strings of this unary binarization for        prefixVal.    -   Otherwise, the bin string is a bit string of length        cMax>>cRiceParam with all bins being equal to 1.

TABLE 4 prefix Val Bin string 0 0 1 1 0 2 1 1 0 3 1 1 1 0 4 1 1 1 1 0 51 1 1 1 1 0 . . . binIdx 0 1 2 3 4 5

When cMax is larger than symbolVal and cRiceParam is larger than 0, thesuffix of the TR bin string is present and it is derived as follows:

-   -   The suffix value suffixVal is derived as follows:

suffixVal=symbolVal−((prefixVal)<<cRiceParam)  (2)

-   -   The suffix of the TR bin string is specified by invoking the        fixed-length (FL) binarization process as specified in clause 4        for suffixVal with a cMax value equal to (1<<cRiceParam)−1.

NOTE—For the input parameter cRiceParam=0, the TR binarization isexactly a truncated unary binarization and it is always invoked with acMax value equal to the largest possible value of the syntax elementbeing decoded.

2. Parsing Process for 0-th Order Exp-Golomb Binarization Process

Syntax elements coded as ue(v) is Exp-Golomb-coded. The parsing processfor these syntax elements begins with reading the bits starting at thecurrent location in the bitstream up to and including the first non-zerobit, and counting the number of leading bits that are equal to 0. Thisprocess is specified as follows:

leadingZeroBits=−1

for(b=0;!b;leadingZeroBits++)

b=read_bits(1)  (3)

The variable codeNum is then assigned as follows:

codeNum=2leadingZeroBits−1+read_bits(leadingZeroBits)  (4)

where the value returned from read_bits(leadingZeroBits) is interpretedas a binary representation of an unsigned integer with most significantbit written first.

Table 5 illustrates the structure of the Exp-Golomb code by separatingthe bit string into “prefix” and “suffix” bits. The “prefix” bits arethose bits that are parsed as specified above for the computation ofleadingZeroBits, and are shown as either 0 or 1 in the bit string columnof Table 5. The “suffix” bits are those bits that are parsed in thecomputation of codeNum and are shown as xi in Table 5, with i in therange of 0 to leadingZeroBits−1, inclusive. Each xi is equal to either 0or 1.

TABLE 5 Bit string form Range of codeNum 1 0 0 1 x₀ 1 . . . 2 0 0 1 x₁x₀ 3 . . . 6 0 0 0 1 x₂ x₁ x₀  7 . . . 14 0 0 0 0 1 x₃ x₂ x₁ x₀ 15 . . .30 0 0 0 0 0 1 x₄ x₃ x₂ x₁ x₀ 31 . . . 62 . . . . . .

Table 6 illustrates explicitly the assignment of bit strings to codeNumvalues. That is, Exp-Golomb bit strings and codeNum is represented inexplicit form and used as ue(v).

TABLE 6 Bit string codeNum 1 0 0 1 0 1 0 1 1 2 0 0 1 0 0 3 0 0 1 0 1 4 00 1 1 0 5 0 0 1 1 1 6 0 0 0 1 0 0 0 7 0 0 0 1 0 0 1 8 0 0 0 1 0 1 0 9 .. . . . .

Depending on the descriptor, the value of a syntax element is derived asfollows:

-   -   If the syntax element is coded as ue(v), the value of the syntax        element is equal to codeNum.

3. k-Th Order Exp-Golomb Binarization Process

Inputs to this process is a request for a k-th order Exp-Golomb (EGk)binarization.

Output of this process is the EGk binarization associating each valuesymbolVal with a corresponding bin string.

The bin string of the EGk binarization process for each value symbolValis specified as follows, where each call of the function put(X), with Xbeing equal to 0 or 1, adds the binary value X at the end of the binstring:

    absV = Abs( symbolVal )   stopLoop = 0   do    if( absV >= (1 << k )) {      put( 1 )      absV = absV − ( 1 << k )      k++    } else {     put( 0 )     (5)      while( k− − )         put( ( absV >> k ) & 1)      stopLoop = 1    }   while( ! stopLoop )   NOTE - Thespecification for the k-th order   Exp-Golomb (EGk) code uses 1's and0's in reverse meaning for the unary part of the Exp-Golomb code of 0-thorder as specified in clause 2.

4. Fixed-Length Binarization Process

Inputs to this process are a request for a fixed-length (FL)binarization and cMax.

Output of this process is the FL binarization associating each valuesymbolVal with a corresponding bin string.

FL binarization is constructed by using the fixedLength bit unsignedinteger bin string of the symbol value symbolVal, wherefixedLength=Ceil(Log 2(cMax+1)). The indexing of bins for the FLbinarization is such that the binIdx=0 relates to the most significantbit with increasing values of binIdx towards the least significant bit.

5. Binarization Process for Abs_Remainder

Input to this process is a request for a binarization for the syntaxelement abs_remainder[n], the colour component cIdx, the luma location(x0, y0) specifying the top-left sample of the current luma transformblock relative to the top-left luma sample of the picture), the currentcoefficient scan location (xC, yC), the binary logarithm of thetransform block width log 2TbWidth, and the binary logarithm of thetransform block height log 2TbHeight.

Output of this process is the binarization of the syntax element.

The rice parameter cRiceParam is derived by invoking the rice parameterderivation process as specified in clause 6 with the colour componentindex cIdx, the luma location (x0, y0), the current coefficient scanlocation hm of the transform block height log 2TbHeight as inputs.

The variable cMax is derived from cRiceParam as:

c Max=(cRiceParam==1?6:7)<<cRiceParam  (6)

The binarization of the syntax element abs_remainder[n] is aconcatenation of a prefix bin string and (when present) a suffix binstring.

For the derivation of the prefix bin string, the following applies:

-   -   The prefix value of abs_remainder[n], prefixVal, is derived as        follows:

prefixVal=Min(cMax,abs_remainder[n])  (7)

-   -   The prefix bin string is specified by invoking the TR        binarization process as specified in clause 1 for prefixVal with        the variables cMax and cRiceParam as inputs.

When the prefix bin string is equal to the bit string of length 4 withall bits equal to 1, the suffix bin string is present and it is derivedas follows:

-   -   The suffix value of abs_remainder[n], suffixVal, is derived as        follows:

suffixVal=abs_remainder[n]−cMax  (8)

-   -   The suffix bin string is specified by invoking the k-th order        EGk binarization process as specified in clause 3 for the        binarization of suffixVal with the Exp-Golomb order k set equal        to cRiceParam+1.

6. Rice Parameter Derivation Process

Inputs to this process are the colour component index cIdx, the lumalocation (x0, y0) specifying the top-left sample of the currenttransform block relative to the top-left sample of the current picture,the current coefficient scan location (xC, yC), the binary logarithm ofthe transform block width log 2TbWidth, and the binary logarithm of thetransform block height log 2TbHeight.

Output of this process is the Rice parameter cRiceParam.

Given the syntax elements sig_coeff_flag[x][y] and the arrayAbsLevel[x][C] for the transform block with component index cIdx and thetop-left luma location (x0, y0), the variable locSumAbs is derived asspecified by the following pseudo code:

 locSumAbs = 0  if( xC < ( 1 << log2TbWidth) − 1 ) {   locSumAbs +=AbsLevel[ xC + 1 ][ yC ] − sig_coeff_flag   [ xC + 1 ][ yC ]   if( xC <(1 << log2TbWidth) − 2 )    locSumAbs += AbsLevel[ xC + 2 ][ yC ] −sig_coeff_flag[ xC + 2 ][ yC ]   if( yC < (1 << log2TbHeight) − 1 )   locSumAbs += AbsLevel[ xC + 1 ][ yC + 1 ] − sig_coeff_flag[ xC + l ][yC + 1 ]  (9)  }  if( yC < (1 << log2TbHeight) − 1 ) {   locSumAbs +=AbsLevel[ xC ][ yC + 1 ] − sig_coeff_flag   [ xC ][ yC + 1 ]   if( yC <(1 << log2TbHeight) − 2 )    locSumAbsPass1 += AbsLevelPass 1 [ xC ][yC + 2 ] − sig_coeff_flag[ xC ][ yC + 2 ]  }

The Rice parameter cRiceParam is derived as follows:

-   -   If locSumAbs is less than 12, cRiceParam is set equal to 0;    -   Otherwise, if locSumAbs is less than 25, cRiceParam is set equal        to 1;    -   Otherwise (locSumAbs is larger than or equal to 25), cRiceParam        is set equal to 2.

FIG. 4 is a diagram for explaining an example of deriving a riceparameter for a current transform coefficient based on neighboringreference transform coefficients according to an embodiment.

As described above in the Section 6 of the English specificationillustrated in FIG. 3 , the rice parameter for the transform coefficientof the current scanning position may be determined based on the levelsum of the already encoded five neighboring transform coefficients(light shaded indication in FIG. 4 ) for the current transformcoefficient (dark shaded indication in FIG. 4 ) and the value of thesig_coeff_flag. In this case, it may be necessary to confirm every timewhether the positions of the reference transform coefficients exceed atransform block boundary. That is, every time one transform coefficientlevel is encoded, five boundary check processes may be accompanied. Morespecifically, since the 5 times of boundary check processes are requiredfor the transform coefficient requiring the encoding of theabs_remainder syntax element, computational complexity may increase if alarge number of transform coefficients having a large level value aregenerated.

Since the computational complexity increases in proportion to the sizeof the reference transform coefficient used in the process of derivingthe rice parameter, the following embodiments propose a method of usingless than 5 reference transform coefficients. FIGS. 5A to 5C illustratea case in which four, three, and two reference transform coefficientsare used, and various reference transform coefficient usage patternscorresponding to each case are illustrated. FIGS. 6A to 6C illustratevarious reference transform coefficient usage patterns in the case ofusing one reference transform coefficient. The purpose of theembodiments according to FIGS. 5A to 6C is to reduce the computationalcomplexity by reducing the number of reference transform coefficients,such that the present disclosure includes all cases where less than 5reference transform coefficients are used, and is not limited to theaforementioned embodiments.

FIGS. 5A to 5C are diagrams for explaining another example of deriving arice parameter for the current transform coefficient based onneighboring reference transform coefficients according to someembodiments.

FIG. 5A is a diagram for explaining a process of deriving a riceparameter based on four neighboring reference transform coefficients(light shaded indication in FIG. 5A) for the current transformcoefficient. A temporary sum coefficient may be derived in the middle toderive the rice parameter. The temporary sum coefficient may berepresented as, for example, locSumAbs. A value of the temporary sumcoefficient (for example, locSumAbs) may be initially zero, and thevalue of the temporary sum coefficient (for example, locSumAbs) may beupdated while detecting each neighboring reference transformcoefficient.

The process of updating the value of the temporary sum coefficient (forexample, locSumAbs) based on the four neighboring reference transformcoefficients illustrated in FIG. 5A may be, for example, expressed inTable 7 below.

TABLE 7 locSumAbS = 0 if( xC < (1 << log2Tb Width) − 1 ) {  locSumAbs +=AbsLevel[ xC + 1 ][ yC ] − sig_coeff_flag  [ xC + 1 ][ yC ]  if( xC < (1<< log2TbWidth) − 2 )   locSumAbs += AbsLevel[ xC + 2 ][ yC ] −sig_coeff_flag   [ xC + 2 ][ yC ] } if( yC < (1 << log2TbHeight) − 1 ) { locSumAbs += AbsLevel[ xC ][ yC + 1 ] − sig_coeff_flag  [ xC ][ yC + 1]  if( yC < (1 << log2TbHeight) − 2 )   locSumAbsPass1 += AbsLevelPass1[ xC ][ yC + 2 ] −   sig_coeff_flag[ xC ][ yC + 2 ] }

FIG. 5B is a diagram for explaining a process of deriving a riceparameter based on three neighboring reference transform coefficients(light shaded indication in FIG. 5B) for the current transformcoefficient. The process of updating the value of the temporary sumcoefficient (for example, locSumAbs) based on the three neighboringreference transform coefficients illustrated in FIG. 5B may be, forexample, expressed in Table 8 below.

TABLE 8 locSumAbs = 0 if( xC < (1 << log2TbWidth) − 1 ) {  locSumAbs +=AbsLevel[ xC + 1 ][ yC ] − sig_coeff_flag  [ xC + l ][ yC ]  if( yC < (1<< log2TbHeight) − 1 )   locSumAbs += AbsLevel[ xC + 1 ][ yC + 1 ] −  sig_coeff_flag[ xC + 1 ][ yC + 1 ] } if( yC < (1 << log2TbHeight) − 1) {  locSumAbs += AbsLevel[ xC ][ yC + 1 ] − sig_coeff_flag  [ xC ][yC + 1 ] }

FIG. 5C is a diagram for explaining a process of deriving a riceparameter based on two neighboring reference transform coefficients(light shaded indication in FIG. 5C) for the current transformcoefficient. The process of updating the value of the temporary sumcoefficient (for example, locSumAbs) based on the two neighboringreference transform coefficients illustrated in FIG. 5C may be, forexample, expressed in Table 9 below.

TABLE 9 locSumAbs = 0 if( xC < (1 << log2TbWidth) − 1) {  locSumAbs +=AbsLevel[ xC + 1 ][ yC ] − sig_coeff_flag  [ xC ][ yC ] } if( yC < (1 <<log2TbHeight) − 1 ) {  locSumAbs += AbsLevel[ xC ][ yC + 1 ] −sig_coeff_flag  [ xC ][ yC + 1 ] }

FIGS. 6A to 6C are diagrams for explaining still another example ofderiving a rice parameter for the current transform coefficient based onthe neighboring reference transform coefficients according to anothersome embodiments.

FIGS. 6A to 6C are diagrams for explaining a process of deriving a riceparameter based on one neighboring reference transform coefficient(light shaded indication in FIGS. 6A to 6C) for the current transformcoefficient. FIG. 6A is a diagram for explaining a process of using aneighboring reference transform coefficient positioned at the right ofthe current transform coefficient, FIG. 6B is a diagram for explaining aprocess of using a neighboring reference transform coefficientpositioned at the lower right diagonal line of the current transformcoefficient, and FIG. 6C is a diagram for explaining a process of usinga neighboring reference transform coefficient positioned below thecurrent transform coefficient.

The process of updating the value of the temporary sum coefficient (forexample, locSumAbs) based on the right neighboring reference transformcoefficient illustrated in FIG. 6A may be, for example, expressed inTable 10 below.

TABLE 10 locSumAbs = 0 if( xC < (1 << log2TbWidth) − 1 ) {  locSumAbs +=AbsLevel[ xC + 1 ][ yC ] − sig_coeff_flag  [ xC + l ][ yC ] }

The process of updating the value of the temporary sum coefficient (forexample, locSumAbs) based on the neighboring reference transformcoefficient of the lower right diagonal line illustrated in FIG. 6B maybe, for example, expressed in Table 11 below.

TABLE 11   locSumAbs = 0 if( xC < (1 << log2TbWidth) − 1 ) {  if( yC <(1 << log2TbHeight) − 1 )   locSumAbs += AbsLevel[ xC + 1 ][ yC + 1 ] −  sig_coeff_flag   [ xC + 1 ][ yC + 1 ] }

The process of updating the value of the temporary sum coefficient (forexample, locSumAbs) based on the lower neighboring reference transformcoefficient illustrated in FIG. 6C may be, for example, expressed inTable 12 below.

TABLE 12   locSumAbs = 0 if( yC < (1 << log2TbHeight) − 1 ) {  locSumAbs+= AbsLevel[ xC ][ yC + 1 ] −  sig_coeff_flag[ xC ]  [ yC + 1 ] }

In an embodiment, as disclosed in the Section 3 of the Englishspecification illustrated in FIG. 3 , it is possible to determine a riceparameter for the transform coefficient of the next scanning positionbased on the locSumAbs value. For example, the rice parameter may bedetermined based on Equation 5 below.

$\begin{matrix}{{cRiceParam} = \left\{ \begin{matrix}{0,} & {{locSumAbs} < 12} \\{1,} & {12 \leq {locSumAbs} < 25} \\{2,} & {{locSumAbs} \geq 25}\end{matrix} \right.} & {{Equation}5}\end{matrix}$

Alternatively, for example, the rice parameter may be determined basedon Equation 6 below.

$\begin{matrix}{{cRiceParam} = \left\{ \begin{matrix}{0,} & {{locSumAbs} < {th}_{1}} \\{1,} & {{th}_{1} \leq {locSumAbs} < {th}_{2}} \\{2,} & {{locSumAbs} \geq {th}_{2}}\end{matrix} \right.} & {{Equation}6}\end{matrix}$

In an embodiment, the th₁ and the th₂ in Equation 6 may be smaller than12 and 25 in Equation 5, respectively, but the embodiment is not limitedthereto.

In an embodiment, if the positions of the referenced neighboringreference transform coefficients exceed the boundary of the transformblock, a method for predicting a rice parameter by using the transformcoefficient values of the referenceable position, a method formaintaining the value of last rice parameter without updating if thelast rice parameter exists, a method for replacing the value of the riceparameter with a specific initial value if the specific initial valueexists, or the like may be used.

Further, a method for determining the scanning order is not limited to adiagonal scan method, and the pattern may be modified when thecoefficient scan method is modified.

FIG. 7 is a diagram illustrating a process of deriving quantizedcoefficients of a 2×2 block according to an embodiment.

In an embodiment, FIG. 7 illustrates an example of the quantizedcoefficients in a 2×2 sub-block in the process of encoding a chromablock. The encoding results for the inversely diagonally scannedcoefficients illustrated in FIG. 7 may be expressed in Table 13 below.In Table 13, the scan_pos represents the position of the coefficientaccording to the inverse diagonal scan. A coefficient which is firstscanned, that is, the lower right corner coefficient in the 2×2 blockmay have the scan_pos value of 3, and a coefficient which is lastlyscanned, that is, the upper left corner coefficient may be representedas the scan_pos value of 0.

TABLE 13 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 1 1par_level_flag 1 1 0 1 rem_abs_gt1_flag 1 1 1 1 rem_abs_gt2_flag 0 1 1 1abs_remainder 0 1 2 ceoff_sign_flag 0 0 1 0

In an embodiment, the number of syntax elements rem_abs_gt2_flags may belimited in the encoding process for the 2×2 sub-block of the chromablock. As expressed above in Table 1, the main syntax elements in unitsof 2×2 sub-block may include sig_coeff_flag, par_level_flag,rem_abs_gt1_flag, rem_abs_gt2_flag, abs_remainder, coeff_sign_flag, andthe like. Among them, the sig_coeff_flag, the par_level_flag, therem_abs_gt1_flag, and the rem_abs_gt2_flag may include information abouta context-encoded bin which is encoded by using the regular encodingengine, and the abs_remainder and the coeff_sign_flag may includeinformation about a bypass bin which is encoded by using the bypassencoding engine. The context-encoded bin may exhibit high datadependency because it uses the updated probability state and range whileprocessing the previous bin. That is, since the context-encoded bin mayperform the encoding/decoding of the next bin after completelyencoding/decoding of the current bin, a parallel processing may bedifficult. Further, it may take a long time to read the probabilitysection and to determine the current state. Accordingly, in anembodiment, a method for improving CABAC throughput by reducing thenumber of context-encoded bins and increasing the number of bypass binsmay be proposed.

In an embodiment, coefficient level information may be encoded in aninverse scanning order. That is, the coefficient level information maybe encoded after being scanned from the coefficients of the lower rightend of the unit block toward those of the upper left end thereof.Generally, the coefficient level which is first scanned in the inversescanning order tends to have a small value. The sig_coeff_flag, thepar_level_flag, the rem_abs_gt1_flag, and the rem_abs_gt2_flag for thesecoefficients may be used to reduce the length of the binarized bins whenthe coefficient level is represented, and the respective syntax elementsmay be efficiently encoded through arithmetic coding according to thepreviously encoded context based on a predetermined context.

However, in the case of some coefficient levels having large values,that is, the coefficient levels positioned at the upper left end of theunit block, using the sig_coeff_flag, the par_level_flag, therem_abs_gt1_flag, and the rem_abs_gt2_flag may not help to improvecompaction performance. Using the sig_coeff_flag, the par_level_flag,the rem_abs_gt1_flag, and the rem_abs_gt2_flag may rather lower encodingefficiency.

In an embodiment, the number of context-encoded bins may be reduced byquickly switching the syntax elements (sig_coeff_flag, par_level_flag,rem_abs_gt1_flag, and rem_abs_gt2_flag) which are encoded into thecontext-encoded bins to the abs_remainder syntax element which isencoded based on the bypass encoding engine, that is, encoded into thebypass bins.

In an embodiment, the number of coefficients encoded with therem_abs_gt2_flag may be limited. The maximum number of rem_abs_gt2_flagswhich may be used for encoding in the 2×2 block may be 4. That is, allcoefficients whose absolute value is larger than 2 may be encoded withthe rem_abs_gt2_flag. In an example, only the first N coefficientshaving the absolute value larger than 2 (that is, coefficients at whichthe rem_abs_gt1_flag is 1) may be encoded with the rem_abs_gt2_flagaccording to the scanning order. The N may be selected by the encoder,and may also be set as any value of 0 to 4. Assuming that thecontext-encoded bin for the luma or chroma 4×4 sub-block is limited tothe encoder in a method similar to the present embodiment, the N mayalso be calculated based on the limit value used at this time. As amethod for calculating the N, the limit value (N_(4×4)) of thecontext-encoded bin for the luma or chroma 4×4 sub-block is used at itis as expressed by Equation 7, or the number of pixels in the 2×2sub-block is 4, thereby calculating the N through Equation 8. Here, thea and b mean constants, and are not limited to specific values.

N=N _(4×4)  Equation 7

N={N _(4×4)>>(4−a)}+b  Equation 8

Similarly, the N may also be calculated by using the horizontal and/orvertical size values of the sub-block. Since the sub-block has a squareshape, the horizontal size value and the vertical size value are thesame. Since the horizontal or vertical size value of the 2×2 sub-blockis 2, the N may be calculated through Equation 9 below.

N={N _(4×4)>>(a−2)}+b  Equation 9

Table 14 below shows an application example when the N is 1. Theencoding for the rem_abs_gt2_flag may be reduced as many as indicated byX in the 2×2 block, thereby reducing the number of context-encoded bins.The abs_remainder values of the coefficients may be changed with respectto the scanning positions where the encoding of the rem_abs_gt2_flag isnot performed as compared to those in Table 13.

TABLE 14 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 1 1par_level_flag 1 1 0 1 rem_abs_gt1_flag 1 1 1 1 rem_abs_gt2_flag 0 X X Xabs_remainder 1 2 3 ceoff_sign_flag 0 0 1 0

In an embodiment, the sum of the number of sig_coeff_flags, the numberof par_level_flags, and the number of rem_abs_gt1_flags in the encodingof the 2×2 sub-block of the chroma block may be limited. Assuming thatthe sum of the number of sig_coeff_flags, the number of par_level_flags,and the number of rem_abs_gt1_flags is limited to K, the K may have avalue of 0 to 12. In an example, when the sum of the number ofsig_coeff_flags, the number of par_level_flags, and the number ofrem_abs_gt1_flags exceeds the K and the sig_coeff_flag, thepar_level_flag, and the rem_abs_gt1_flag are not encoded, therem_abs_gt2_flag may not be encoded either.

The K may be selected by the encoder, and may also be set as any valueof 0 to 12. If the context-encoded bin for the luma or chroma 4×4sub-block is limited to the encoder, the K may also be calculated basedon the limit value used at this time. As a method for calculating the K,the limit value (K_(4×4)) of the context-encoded bin for the luma orchroma 4×4 sub-block is used as it is as expressed by Equation 10 below,or the number of pixels in the 2×2 sub-block is 4, thereby calculatingthe K through Equation 11.

Here, the a and b mean constants, and are not limited to specificvalues.

K=K _(4×4)  Equation 10

K={K _(4×4)>>(4−a)}+b  Equation 11

Similarly, the K may also be calculated by using the horizontal/verticalsize values of the sub-block. Since the sub-block has a square shape,the horizontal size value and the vertical size value are the same.Since the horizontal or vertical size value of the 2×2 sub-block is 2,the K may be calculated through Equation 12.

K={K _(4×4)>>(a−2)}+b  Equation 12

Table 15 below shows the case where the K is limited to 6.

TABLE 15 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 X Xpar_level_flag 1 1 X X rem_abs_gt1_flag 1 1 X X rem_abs_gt2_flag 0 1 X Xabs_remainder 0 7 10 ceoff_sign_flag 0 0 1 0

In an embodiment, the sum of the number of sig_coeff_flags, the numberof par_level_flags, and the number of rem_abs_gt1_flags, and the numberof rem_abs_gt2_flags may be each limited in the encoding of the 2×2sub-block of the chroma block. That is, a method for limiting the sum ofthe number of sig_coeff_flags, the number of par_level_flags, and thenumber of rem_abs_gt1_flags and a method for limiting the number ofrem_abs_gt2_flags may also be combined. Assuming that the sum of thenumber of sig_coeff_flags, the number of par_level_flags, and the numberof rem_abs_gt1_flags is limited to K, and the number ofrem_abs_gt2_flags is limited to N, the K may have a value of 0 to 12,and the N may have a value of 0 to 4.

The K and the N may also be determined by the encoder, or may also becalculated based on the contents described with regard to Equations 7 to12.

Table 16 below shows an example in which the K is limited to 6 and the Nis limited to 1.

TABLE 16 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 X Xpar_level_flag 1 1 X X rem_abs_gt1_flag 1 1 X X rem_abs_gt2_flag 0 X X Xabs_remainder 1 7 10 ceoff_sign_flag 0 0 1 0

In an embodiment, a method for changing the encoding order of thepar_level_flag and the rem_abs_gt1_flag may be used. For example, amethod for encoding in the order of the rem_abs_gt1_flag and thepar_level_flag may be proposed without encoding in the order of thepar_level_flag and the rem_abs_gt1_flag. In an example, theaforementioned change of the encoding order may be applied when the 2×2sized sub-block of the chroma block is encoded. If the order of thepar_level_flag and the rem_abs_gt1_flag is changed, the rem_abs_gt1_flagis encoded after the sig_coeff_flag, and the par_level_flag may beencoded only when the rem_abs_gt1_flag is 1. Accordingly, therelationship between the actual transform coefficient value (coeff) andthe respective syntax elements may be changed as expressed by Equation13 below.

|coeff|=sig_coeff_flag+rem_abs_gt1_flag+par_level_flag+2*(rem_abs_gt2_flag+abs_remainder)  Equation13

When Table 17 below is compared with Table 2, the par_level_flag is notencoded if the |coeff| is 1, such that the embodiment according to Table16 may have advantages in terms of throughput and encoding. Of course,the rem_abs_gt2_flag is required to be encoded if the |coeff| is 2unlike in Table 2, and the abs_remainder is required to be encoded ifthe |coeff| is 4 unlike in Table 2, but generally, the case where the|coeff| is 1 occurs more frequently than the case where the |coeff| is 2or 4, such that the method according to Table 17 may exhibit higherthroughput and encoding performance than the method according to Table2. In an example, the result of encoding the 4×4 sub-block asillustrated in FIG. 7 may be expressed in Table 18 below.

TABLE 17 sig_coeff_ rem_abs_ par_level_ rem_abs_ abs_ |coeff| flaggt1_flag flag gt2_flag remainder 0 0 1 1 0 2 1 1 0 0 3 1 1 1 0 4 1 1 0 10 5 1 1 1 1 0 6 1 1 0 1 1 7 1 1 1 1 1 8 1 1 0 1 2 9 1 1 1 1 2 10 1 1 0 13 11 1 1 1 1 3 . . . . . . . . . . . . . . . . . .

TABLE 18 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 1 1rem_abs_gt1_flag 1 1 1 1 par_level_flag 0 0 1 0 rem_abs_gt2_flag 1 1 1 1abs_remainder 0 1 1 3 ceoff_sign_flag 0 0 1 0

In an embodiment, a method for changing the encoding order of thepar_level_flag and the rem_abs_gt1_flag, and limiting the sum of thenumber of sig_coeff_flags, the number of rem_abs_gt1_flags, and thenumber of par_level_flags may be provided. That is, when encoding isperformed in the order of the sig_coeff_flag, the rem_abs_gt1_flag, thepar_level_flag, the rem_abs_gt2_flag, the abs_remainder, and thecoeff_sign_flag, a method for limiting the sum of the number ofsig_coeff_flags, the number of rem_abs_gt1_flags, and the number ofpar_level_flags may be provided. Assuming that the sum of the number ofsig_coeff_flags, the number of rem_abs_gt1_flags, and the number ofpar_level_flags is limited to K, the K may have a value of 0 to 12. TheK may also be selected by the encoder, and may also be set as any valueof 0 to 12. Further, the K may be calculated based on the aforementionedmethod with regard to Equations 10 to 12.

In an embodiment, when the sig_coeff_flag, the rem_abs_gt1_flag, and thepar_level_flag are no longer encoded, the rem_abs_gt2_flag may not beencoded either. Table 19 below shows an example in which the K is 6.

TABLE 19 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 X Xrem_abs_gt1_flag 1 1 X X par_level_flag 0 0 X X rem_abs_gt2_flag 1 1 X Xabs_remainder 0 1 7 10 ceoff_sign_flag 0 0 1 0

In an embodiment, the syntax elements sig_coeff_flag, rem_abs_gt1_flagand par_level_flag may be encoded within one for loop in the syntax.Although the sum of the number of three syntax elements (sig_coeff_flag,rem_abs_gt1_flag, and par_level_flag) does not exceed K, and the sumdoes not exactly match the K, the encoding may be stopped at the samescanning position. Table 19 below shows an example in which the K is 8.When encoding is performed up to a scanning position 2, the sum of thenumber of sig_coeff_flags, the number of rem_abs_gt1_flags, and thenumber of par_level_flags is 6. The sum is a value which does not exceedthe K, but at this time, since the encoding apparatus (or encoder) doesnot know the value of the coefficient level of the next scanningposition 1 (scan_pos=1), the encoding apparatus (or encoder) may notrecognize that the number of context-encoded bins generated in thescan_pos=1 has any value of 1 to 3. At this time, the encoding apparatusmay encode only up to the scan_pos=2 and terminate the encoding.Accordingly, although the K value is different, the encoding results maybe the same in Table 19 and Table 20 below.

TABLE 20 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 X Xrem_abs_gt1_flag 1 1 X X par_level_flag 0 0 X X rem_abs_gt2_flag 1 1 X Xabs_remainder 0 1 7 10 ceoff_sign_flag 0 0 1 0

In an embodiment, a method for changing the encoding order of thepar_level_flag and the rem_abs_gt1_flag, and limiting the number ofrem_abs_gt2_flags may be provided. That is, when encoding is performedin the order of the sig_coeff_flag, the rem_abs_gt1_flag, thepar_level_flag, the rem_abs_gt2_flag, the abs_remainder, and thecoeff_sign_flag, a method for limiting the sum of the number ofcoefficients encoded with the rem_abs_gt2_flag may be provided. In anexample, the number of rem_abs_gt2_flags encoded within the 2×2 blockmay be 4. That is, all coefficients whose absolute value is larger than2 may be encoded with the rem_abs_gt2_flag. In another example, only thefirst N coefficients having an absolute value larger than 2 (that is,coefficients at which the rem_abs_gt1_flag is 1) may also be encodedwith the rem_abs_gt2_flag according to the scanning order. The N mayalso be selected by the encoder, and may also be set as any value of 0to 4. Further, the N may also be calculated based on the aforementionedmethod with regard to Equations 7 to 9.

Table 21 shows an example when the N is 1. The encoding for therem_abs_gt2_flag may be reduced as many as indicated by X in the 4×4block, thereby reducing the number of context-encoded bins. Theabs_remainder values of coefficients may be changed with respect to thescanning positions where the rem_abs_gt2_flag is not encoded asexpressed in Table 21 below as compared with those in Table 18.

TABLE 21 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 1 1rem_abs_gt1_flag 1 1 1 1 par_level_flag 0 0 1 0 rem_abs_gt2_flag 1 X X Xabs_remainder 0 2 2 4 ceoff_sign_flag 0 0 1 0

In an embodiment, a method for changing the encoding order of thepar_level_flag and the rem_abs_gt1_flag, and limiting the sum of thenumber of sig_coeff_flags, the number of rem_abs_gt1_flags, and thenumber of par_level_flags, and the number of rem_abs_gt2_flags may beprovided. That is, when encoding is performed in the order of thesig_coeff_flag, the rem_abs_gt1_flag, the par_level_flag, therem_abs_gt2_flag, the abs_remainder, and the coeff_sign_flag, the methodfor limiting the sum of the number of sig_coeff_flags, the number ofrem_abs_gt1_flags, and the number of par_level_flags and the method forlimiting the number of rem_abs_gt2_flags may be combined. Assuming thatthe sum of the number of sig_coeff_flags, the number ofrem_abs_gt1_flags, and the number of par_level_flags is limited to K,and the number of rem_abs_gt2_flags is limited to N, the K may have avalue of 0 to 12, and the N may have a value of 0 to 4. The K and the Nmay also be selected by the encoder, and the K may also be set as anyvalue of 0 to 12 and the N may also be set as any value of 0 to 4.Alternatively, the K and the N may also be calculated based on thecontents described with regard to Equations 7 to 12.

Table 22 shows an example in which the K is 6 and the N is 1.

TABLE 22 scan_pos 3 2 1 0 coefficients 4 6 −7 10 sig_coeff_flag 1 1 X Xrem_abs_gt1_flag 1 1 X X par_level_flag 0 0 X X rem_abs_gt2_flag 1 X X Xabs_remainder 0 2 7 10 ceoff_sign_flag 0 0 1 0

According to an embodiment, in the case of limiting the sum of thenumber of sig_coeff_flags, the number of par_level_flags, and the numberof rem_abs_gt1_flags in the encoding of the 2×2 or 4×4 sub-block of thechroma block, a method for simplifying determining the rice parameterused to define golomb codes for the abs_remainder may be provided. In anembodiment, referring back to FIG. 4 , the rice parameter for thetransform coefficient of the current scanning position may be determinedbased on the level sum of the already encoded neighboring five transformcoefficients (light shaded indication in FIG. 4 ) of the currenttransform coefficient (dark shaded indication in FIG. 4 ) andinformation about the sig_coeff_flag. Table 22 below shows the pseudocode related to FIG. 4 . Referring to Table 23 below, it may beconfirmed that it is necessary to check every time whether the positionsof the transform coefficients referred to in the pseudo code exceed thetransform block boundary. That is, it is necessary to perform fiveboundary check processes every time one transform coefficient level isencoded. Even in the encoding of the abs_remainder syntax element, sincethe 5 times of boundary check processes are required for the transformcoefficient of the target which requires the encoding, the computationalcomplexity may increase if a large number of transform coefficientshaving large level values are generated.

TABLE 23 locSumAbs = 0 if( xC < (1 << log2TbWidth) − 1 ) {  locSumAbs +=AbsLevel[ xC + 1 ][ yC ] − sig_coeff_flag  [ xC + l ][ yC ]  if( xC < (1<< log2TbWidth) − 2 )   locSumAbs += AbsLevel[ xC + 2 ][ yC ] −  sig_coeff_flag [ xC + 2 ][ yC ]  if( yC < (1 << log2TbHeight) − 1 )  locSumAbs += AbsLevel[ xC + 1 ][ yC + 1 ] −   sig_coeff_flag   [ xC +1 ][ yC + 1 ] } if( yC < (1 << log2TbHeight) − 1 ) {  locSumAbs +=AbsLevel[ xC ][ yC + 1 ] − sig_coeff_flag  [ xC ][ yC + 1 ]  if( yC < (1<< log2TbHeight) − 2 )   locSumAbsPass1 += AbsLevelPass1 [ xC ][ yC + 2] −   sig_coeff_flag[ xC ][ yC + 2 ] }

According to an embodiment, in a method for deriving cRiceParamrepresenting a rice parameter, a value of the cRiceParam may be 0 iflocSumAbs is less than 12, the value of the cRiceParam may be 1 if thelocSumAbs is less than 25, and the value of the cRiceParam may be 2 ifthe value of the locSumAbs is 25 or more.

In an embodiment, if the sum of the number of sig_coeff_flags, thenumber of rem_abs_gt1_flags, and the number of par_level_flags islimited, the abs_remainder may be determined differently, respectively,according to the following three cases. In the method for limiting thesum of the number of sig_coeff_flags, the number of rem_abs_gt1_flags,and the number of par_level_flags, various coding processes may beapplied to sub-blocks according to the following (i), (ii), and (iii).The (i) may represent a case where all of the sig_coeff_flag, thepar_level_flag, the rem_abs_gt1_flag, and the rem_abs_gt2_flag exist,the (ii) represent a case where only the sig_coeff_flag, thepar_level_flag, and the rem_abs_gt1_flag exist, and the (iii) representa case where none of the sig_coeff_flag, the par_level_flag, therem_abs_gt1_flag, and the rem_abs_gt2_flag exist.

In the case of the (i), the relationship between the actual transformcoefficient value (coeff) and the abs_remainder is expressed by Equation4, in the case of the (ii) the relationship therebetween is as expressedby Equation 14, and in the case of the (iii), the relationshiptherebetween is as expressed by Equation 15.

|coeff|=sig_coeff_flag+par_level_flag+2*(rem_abs_gt1_flag+abs_remainder)  Equation14

|coeff|=abs_remainder  Equation 15

Since the computational complexity increases in proportion to the sizeof the reference transform coefficient used in the process of derivingthe rice parameter, an embodiment may derive the rice parameter based onthe just before level value under the scanning order of the 4×4 or 2×2sub-block only for the encoding of the chroma block. At this time, therice parameter may be initialized to zero only in the start step of thesub-block, and each step of the (i), (ii), and (iii) which encode theabs_remainder within the sub-block may not initialize the riceparameter. In the encoding of the sub-block, the rice parameterincreases by 1 when the just before level value is larger than th₁, th₂or th₃. In the present disclosure, the th₁ and the th₂ are not limitedto specific values, but in an embodiment, the th₁ may be determined as1, 2 or 3, th₂ may be determined as 4, 5 or 6, and th₃ may be determinedas 10, 11 or 12.

According to an embodiment, in the case of changing the encoding orderof the par_level_flag and the rem_abs_gt1_flag in the encoding of the2×2 or 4×4 sub-block of the chroma block, and limiting the sum of thenumber of sig_coeff_flags, the number of rem_abs_gt1_flags, and thenumber of par_level_flags, a method for simplifying the determining ofthe rice parameter used to define the golomb codes for the abs_remaindermay be provided.

In the case of changing the encoding order of the par_level_flag and therem_abs_gt1_flag, the abs_remainder may be determined differently,respectively, according to the following three cases if the sum of thenumber of sig_coeff_flags, the number of rem_abs_gt1_flags, and thenumber of par_level_flags is limited. According to the method forlimiting the sum of the number of sig_coeff_flags, the number ofrem_abs_gt1_flags, and the number of par_level_flags, the following (i),(ii), and (iii) may be checked with regard to one sub-block. The (i) isa case where all of the sig_coeff_flag, the rem_abs_gt1_flag, thepar_level_flag, and the rem_abs_gt2_flag exist, the (ii) is a case whereonly the sig_coeff_flag, the rem_abs_gt1_flag, and the par_level_flagexist, and the (iii) is a case where all of the sig_coeff_flag, therem_abs_gt1_flag, the par_level_flag, and rem_abs_gt2_flag do not exist.

In the case of the (i), the relationship between the actual transformcoefficient value (coeff) and the abs_remainder is expressed by Equation13, in the case of the (ii), the relationship therebetween is expressedby Equation 16, and in the case of the (iii), the relationshiptherebetween is expressed by Equation 15.

|coeff|=sig_coeff_flag+rem_abs_gt1_flag+par_level_flag+(2*abs_remainder)  Equation 16

Since the computational complexity increases in proportion to the sizeof the reference transform coefficient used in the process of derivingthe rice parameter, an embodiment may provide a method for driving therice parameter by using the just before level value under the scanningorder of the 4×4 or 2×2 sub-block only for the encoding of the chromablock. The rice parameter may be initialized to zero only in the startstep of the sub-block, and in each stage of the (i), (ii) and (iii)which encode the abs_remainder within the sub-block, the rice parametermay not be initialized. In the encoding of the sub-block, the riceparameter may increase by 1 when the just before level value is largerthan th₁, th₂ or th₃. In the present disclosure, the th₁ and the th₂ arenot limited to specific values, but in an embodiment, the th₁ may bedetermined as 1, 2 or 3, the th₂ may be determined as 4, 5 or 6, and theth₃ may be determined as 10, 11 or 12.

FIGS. 8A and 8B are diagrams illustrating a configuration and anoperation method of an entropy encoder according to an embodiment.

According to an embodiment, from 0th rice code to a maximum 2th ricecode may be used, and the order of the rice code may be expressed as arice parameter. If the order of the rice code, that is, the value of themaximum rice parameter is increased, there may be an advantage in thatfewer bits may be assigned if a large input value is input. Table 24below shows the codeword length from the 0th rice code to the 3rd ricecode as an example, and it may be confirmed that the binarization withthe 3rd rice code is shorter in resulting codeword length than thebinarization with the 2nd rice code if the input value is larger than11. Accordingly, in an embodiment, a method for increasing the order ofthe maximum supported rice code, that is, the value of the maximum riceparameter in the transform coefficient level encoding may be provided.

TABLE 24 cRice- cRice- cRice- cRice- value Param = 0 Param = 1 Param = 2Param = 3 0 1 2 3 4 1 2 2 3 4 2 3 3 3 4 3 4 3 3 4 4 5 4 4 4 5 6 4 4 4 67 5 4 4 7 9 5 4 4 8 9 6 5 5 9 11 6 5 5 10 11 7 5 5 11 11 7 5 5 12 11 9 65 13 13 9 6 5 14 13 9 6 5 15 13 9 6 5 16 13 11 7 6 17 13 11 7 6 18 13 117 6 19 13 11 7 6 20 13 11 8 6 21 15 11 8 6 22 15 11 8 6 23 15 11 8 6 2415 13 9 7 25 15 13 9 7 26 15 13 9 7 27 15 13 9 7 28 15 13 11 7 29 15 1311 7 30 15 13 11 7 31 15 13 11 7

As the maximum rice parameter increases, Equation 6, which classifiesthe rice parameter based on the locSumAbs, may be modified as expressedby Equation 17 below. Equation 17 shows an example of the case of usingup to the 3rd rice code.

$\begin{matrix}{{cRiceParam} = \left\{ \begin{matrix}{0,} & {{locSumAbs} < {th}_{1}} \\{1,} & {{th}_{1} \leq {locSumAbs} < {th}_{2}} \\{2,} & {{th}_{2} \leq {locSumAbs} < {th}_{3}} \\{3,} & {{locSumAbs} \geq {th}_{3}}\end{matrix} \right.} & {{Equation}17}\end{matrix}$

Referring to FIGS. 8A and 8B, the encoding apparatus (entropy encoder240) may perform a residual coding procedure for (quantized) transformcoefficients. As described above, the encoding apparatus may residualcode the (quantized) transform coefficients within the current block(current CB or current TB) according to the scanning order. The encodingapparatus may generate and encode various syntax elements related toresidual information, for example, as expressed in Table 1.

Specifically, the encoding apparatus may derive a value of theabs_remainder while encoding the sig_coeff_flag, the par_level_flag, therem_abs_gt1_flag, and the rem_abs_gt2_flag, and derive a rice parameterfor the abs_remainder (S800). The rice parameter may be derived based onthe neighboring reference transform coefficient as described above. Morespecifically, the rice parameter for (the transform coefficient of) thecurrent scanning position may be derived based on the aforementionedlocSumAbs, and the locSumAbs may be derived based on the AbsLevel and/orthe sig_coeff_flag of the neighboring reference transform coefficients.The positions and number of the neighboring reference transformcoefficients may include the contents described in FIGS. 4 to 6C. Theprocedure of deriving the rice parameter may be performed by a riceparameter deriver 242 within the entropy encoder 240.

The encoding apparatus may perform binarization on the value of theabs_remainder based on the derived rice parameter (S810). In thebinarization procedure, the aforementioned description may be applied inthe Section 5 (binarization process for abs_remainder) of the Englishspecification included in the description of FIG. 3 . The encodingapparatus may derive a bin string for the abs_remainder through thebinarization procedure. The binarization procedure may be performed by abinarizer 244 within the entropy encoder 240. According to the presentdisclosure, as described above, the length of the bin string for thevalue of the abs_remainder may be determined adaptively based on therice parameter. For example, as expressed in Table 23, the length of thevalue to be encoded may be adaptively determined based on the riceparameter. According to the present disclosure, the rice parameter forthe value of the abs_remainder of the current transform coefficient maybe derived based on the neighboring reference transform coefficients,and accordingly, a relatively shorter bin string may be assignedadaptively than when the fixed rice parameter is used with respect tothe value of the abs_remainder of the current transform coefficient.

It is apparent to those skilled in the art that the procedure ofderiving the rice parameter may be omitted for the sig_coeff_flag, thepar_level_flag, the rem_abs_gt1_flag, the rem_abs_gt2_flag, and the likewhich are binarized based on the FL without using the rice parameter.The sig_coeff_flag, the par_level_flag, the rem_abs_gt1_flag, therem_abs_gt2_flag, and the like may not be binarized based on the riceparameter, but binarized according to the Section 4 (Fixed-lengthbinarization process) of the English specification included in thedescription of FIG. 3 .

The encoding apparatus may perform entropy encoding based on the binstring for the abs_remainder (S820). The encoding apparatus may entropyencode the bin string based on the context based on an entropy codingtechnique such as context-adaptive arithmetic coding (CABAC) orcontext-adaptive variable length coding (CAVLC), and the output thereofmay be included in a bitstream. The entropy encoding procedure may beperformed by an entropy encoding processor 244 within the entropyencoder 240. As described above, the bitstream may include variousinformation for image/video decoding such as prediction information inaddition to the residual information including the information about theabs_remainder. The bitstream may be delivered to the decoding apparatusthrough a (digital) storage medium or a network.

FIGS. 9A and 9B are diagrams illustrating a configuration and anoperation method of an entropy decoder according to an embodiment.

Referring to FIGS. 9A and 9B, the decoding apparatus (entropy decoder)may decode the encoded residual information to derive (quantized)transform coefficients. As described above, the decoding apparatus maydecode the encoded residual information for the current block (currentCB or current TB) to derive the (quantized) transform coefficients. Forexample, the decoding apparatus may decode various syntax elementsrelated to the residual information as expressed in Table 1, and derivethe (quantized) transform coefficients based on the values of relatedsyntax elements.

Specifically, the decoding apparatus may derive a rice parameter for theabs_remainder (S900). As described above, the rice parameter may bederived based on the neighboring reference transform coefficient.Specifically, the rice parameter for (the transform coefficient of) thecurrent scanning position may be derived based on the aforementionedlocSumAbs, and the locSumAbs may be derived based on the AbsLevel and/orthe sig_coeff_flag of the neighboring reference transform coefficients.The positions and number of the neighboring reference transformcoefficients may include the aforementioned descriptions in FIGS. 4 to6C. The procedure of deriving the rice parameter may be performed by therice parameter deriver 312 in the entropy decoder 310.

The decoding apparatus may perform binarization for the abs_remainderbased on the derived rice parameter (S910). In the binarizationprocedure, the aforementioned description may be applied in the Section5 (Binarization process for abs_remainder) of the English specificationincluded in the description of FIG. 3 . The decoding apparatus mayderive available bin strings for available values of the abs_remainderthrough the binarization procedure. The binarization procedure may beperformed by the binarizer 314 in the entropy decoder 310. According tothe present disclosure, as described above, the length of the bin stringfor the value of the abs_remainder may be determined adaptively based onthe rice parameter. For example, as expressed in Table 23, the length ofthe value to be encoded may be adaptively determined based on the riceparameter. According to the present disclosure, the rice parameter forthe value of the abs_remainder of the current transform coefficient maybe derived based on the neighboring reference transform coefficients,and accordingly, a relatively shorter bin string may be assignedadaptively than when the fixed rice parameter is used with respect tothe value of the abs_remainder of the current transform coefficient.

The decoding apparatus may perform entropy decoding for theabs_remainder (S920). The decoding apparatus may parse and decode eachbin for the abs_remainder sequentially, and compare the derived binstring with the available bin strings. If the derived bin string isequal to one of the available bin strings, a value corresponding to thecorresponding bin string may be derived as the value of theabs_remainder. Otherwise, the comparison procedure may be performedafter further parsing and decoding the next bit within the bitstream.Through such a process, the corresponding information may be signaled byusing a variable length bit even without using a start bit or an end bitfor specific information (specific syntax element) within the bitstream.Accordingly, the decoding apparatus may assign relatively fewer bits toa low value, and improve overall coding efficiency.

The decoding apparatus may perform context-based entropy decoding forthe respective bins within the bin string from the bitstream based on anentropy coding technique such as CABAC or CAVLC. The entropy decodingprocedure may be performed by an entropy decoding processor 316 withinthe entropy decoder 310. As described above, the bitstream may includevarious information for image/video decoding such as predictioninformation in addition to the residual information including theinformation about the abs_remainder.

It is apparent to those skilled in the art that the procedure ofderiving the rice parameter may be omitted for the sig_coeff_flag, thepar_level_flag, the rem_abs_gt1_flag, the rem_abs_gt2_flag, and the likewhich are binarized based on the FL without using the rice parameter.The sig_coeff_flag, the par_level_flag, the rem_abs_gt1_flag, therem_abs_gt2_flag, and the like may not be binarized based on the riceparameters, but binarized according to the Section 4 (Fixed-lengthbinarization process) of the English specification included in thedescription of FIG. 3 .

As described above, the bitstream may include various information forimage/video decoding such as prediction information in addition to theresidual information including the information about the abs_remainder.As described above, the bitstream may be delivered to the decodingapparatus through a (digital) storage medium or a network.

The decoding apparatus may derive residual samples for the current blockby performing dequantization and/or inverse transformation proceduresbased on the (quantized) transform coefficients. As described above,reconstruction samples may be generated based on the residual samplesand the prediction samples derived through inter/intra prediction, and areconstructed picture including the reconstruction samples may begenerated.

FIG. 10 is a flowchart illustrating an entropy encoding method of anencoding apparatus according to an embodiment.

S810 and S820 described above with reference to FIG. 8A may be includedin S1040 illustrated in FIG. 10 .

S1000 may be performed by the inter predictor 221 or the intra predictor222 of the encoding apparatus, and S1010, S1020, S1030, and S1040 may beperformed by the subtractor 231, the transformer 232, the quantizer 233,and the entropy encoder 240 of the encoding apparatus, respectively.

The encoding apparatus according to an embodiment may derive predictionsamples through prediction for a current block (S1000). The encodingapparatus may determine whether to perform inter prediction or intraprediction on the current block, and determine a specific interprediction mode or a specific intra prediction mode based on a RD cost.According to the determined mode, the encoding apparatus may derive theprediction samples for the current block.

The encoding apparatus according to an embodiment may derive residualsamples by comparing the original samples with the prediction samplesfor the current block (S1010).

The encoding apparatus according to an embodiment may derive transformcoefficients through a transform procedure for the residual samples(S1020) and derive quantized transform coefficients by quantizing thederived transform coefficients (S1030).

The encoding apparatus according to an embodiment may encode imageinformation including prediction information and residual information,and output the encoded image information in the form of a bitstream(S1040). The prediction information is information related to theprediction procedure, and may include prediction mode information,information about motion information (for example, a case where theinter prediction is applied), and the like. The residual information isinformation about the quantized transform coefficients, and may include,for example, information disclosed in Table 1 above.

The output bitstream may be delivered to the decoding apparatus througha storage medium or a network.

FIG. 11 is a flowchart illustrating an entropy decoding method of adecoding apparatus according to an embodiment.

S910 to S920 described above in FIG. 9 may be included in S1110illustrated in FIG. 11 .

S1100 may be performed by the inter predictor 260 or the intra predictor265 of the decoding apparatus. In S1100, a procedure of decoding theprediction information included in the bitstream and deriving the valuesof the related syntax elements may be performed by the entropy decoder310 of the decoding apparatus. S1110, S1120, S1130, and S1140 may beperformed by the entropy decoder 210, the dequantizer 220, the inversetransformer 230, and the adder 235 of the decoding apparatus,respectively.

The decoding apparatus according to an embodiment may perform anoperation corresponding to an operation which is performed in theencoding apparatus. The decoding apparatus may perform inter predictionor intra prediction on the current block based on the receivedprediction information and derive prediction samples (S1100).

The decoding apparatus according to an embodiment may derive quantizedtransform coefficients for the current block based on the receivedresidual information (S1110).

The decoding apparatus according to an embodiment may dequantize thequantized transform coefficients to derive transform coefficients(S1120).

The decoding apparatus according to an embodiment may derive residualsamples through an inverse transform procedure on the transformcoefficients (S1130).

The decoding apparatus according to an embodiment may generatereconstruction samples for the current block based on the predictionsamples and the residual samples, and generate a reconstructed picturebased on the reconstruction samples (S1340). As described above,thereafter, an in-loop filtering procedure may be further applied to thereconstructed picture.

FIG. 12 is a flowchart illustrating an operation of the encodingapparatus according to an embodiment, and FIG. 13 is a block diagramillustrating a configuration of the encoding apparatus according to anembodiment.

The encoding apparatus according to FIGS. 12 and 13 may performoperations corresponding to the decoding apparatus according to FIGS. 14and 15 . Accordingly, the operations of the decoding apparatus to bedescribed later in FIGS. 14 and 15 may also be applied to the encodingapparatus according to FIGS. 12 and 13 .

Each step illustrated in FIG. 12 may be performed by the encodingapparatus 200 illustrated in FIG. 2 . More specifically, S1200 may beperformed by the subtractor 231 illustrated in FIG. 2 , S1210 may beperformed by the transformer 232 illustrated in FIG. 2 , S1220 may beperformed by the quantizer 233 illustrated in FIGS. 2 , and S1230 may beperformed by the entropy encoder 240 illustrated in FIG. 2 . Further,the operations according to S1200 to S1230 are based on some of theaforementioned descriptions with reference to FIGS. 4 to 11 .Accordingly, detailed descriptions which overlap with the aforementioneddescriptions with reference to FIGS. 2 and 4 to 11 will be omitted orsimplified.

As illustrated in FIG. 13 , the encoding apparatus according to anembodiment may include the subtractor 231, the transformer 232, thequantizer 233, and the entropy encoder 240. However, in some cases, allof the components illustrated in FIG. 13 may not be essential componentsof the encoding apparatus, and the encoding apparatus may be implementedby more or fewer components than the components illustrated in FIG. 13 .

In the encoding apparatus according to an embodiment, the subtractor231, the transformer 232, the quantizer 233, and the entropy encoder 240may also be implemented as separate chips, respectively, or at least twocomponents may also be implemented through a single chip.

The encoding apparatus according to an embodiment may derive a residualsample for the current block (S1200). More specifically, the subtractor231 of the encoding apparatus may derive the residual sample for thecurrent block.

The encoding apparatus according to an embodiment may derive thetransform coefficient by transforming the residual sample for thecurrent block (S1210). More specifically, the transformer 232 of theencoding apparatus may derive the transform coefficient by transformingthe residual sample for the current block.

The encoding apparatus according to an embodiment may derive a quantizedtransform coefficient from the transform coefficient based on aquantization process (S1220). More specifically, the quantizer 233 ofthe encoding apparatus may derive the quantized transform coefficientfrom the transform coefficient based on the quantization process.

The encoding apparatus according to an embodiment may encode residualinformation including information about the quantized transformcoefficient (S1230). More specifically, the entropy encoder 240 of theencoding apparatus may encode the residual information including theinformation about the quantized transform coefficient.

In an embodiment, the residual information includes transformcoefficient level information, and the encoding of the residualinformation may include deriving a binarization value of the transformcoefficient level information by performing a binarization process forthe transform coefficient level information based on a rice parameterand encoding the binarization value of the transform coefficient levelinformation. In an example, the rice parameter may be represented ascRiceParam.

In an embodiment, the maximum value of the rice parameter may be 3. Inan example, the maximum value of the cRiceParam may be 3.

In an embodiment, an initialization process may be performed to deriveat least one rice parameter for the current sub-block included in thecurrent block.

In an embodiment, the rice parameter for the current transformcoefficient within the current sub-block is derived based on the lastrice parameter for the transform coefficient in the previous order ofthe current transform coefficient, and if the current transformcoefficient is the first transform coefficient of the current sub-block,the value of the last rice parameter for the transform coefficient ofthe previous order may be zero. In an example, the last rice parametermay be represented as lastRiceParam. In an example, the size of thecurrent sub-block may be 2×2 or 4×4.

In an embodiment, the rice parameter for the current transformcoefficient may be derived based on the neighboring reference transformcoefficients of the current transform coefficient, and the number ofneighboring reference transform coefficients may be 4 or less.

In an embodiment, a temporary sum coefficient may be derived based onthe neighboring reference transform coefficients, a value of the riceparameter may be determined as zero when a value of the temporary sumcoefficient is less than a first threshold, the value of the riceparameter may be determined as 1 if the value of the temporary sumcoefficient is the first threshold or more and smaller than a secondthreshold, the value of the rice parameter may be determined as 2 if thevalue of the temporary sum coefficient is the second threshold or moreand smaller than a third threshold, and the value of the rice parametermay be determined as 3 if the value of the temporary sum coefficient isthe third threshold or more. In an example, the temporary sumcoefficient may be represented as locSumAbs.

In an embodiment, the first threshold may be 1, 2 or 3, the secondthreshold may be 4, 5 or 6, and the third threshold may be 10, 11 or 12.In an example, the first threshold may be represented as th₁, the secondthreshold may be represented as th₂, and the third threshold may berepresented as th₃.

According to the encoding apparatus and an operation method of theencoding apparatus illustrated in FIGS. 12 and 13 , it is characterizedthat the encoding apparatus derives a residual sample for a currentblock (S1200), derives a transform coefficient by transforming theresidual sample for the current block (S1210), derives a quantizedtransform coefficient from the transform coefficient based on aquantization process (S1220), and encodes residual information includinginformation about the quantized transform coefficient (S1230), theresidual information includes transform coefficient level information,and the encoding of the residual information includes deriving abinarization value of the transform coefficient level information byperforming a binarization process for the transform coefficient levelinformation based on a rice parameter and encoding the binarizationvalue of the transform coefficient level information, and the maximumvalue of the rice parameter is 3. That is, residual coding may beefficiently performed by setting the maximum value of the rice parameteras 3.

FIG. 14 is a flowchart illustrating an operation of the decodingapparatus according to an embodiment, and FIG. 15 is a block diagramillustrating a configuration of the decoding apparatus according to anembodiment.

Each step illustrated in FIG. 14 may be performed by the decodingapparatus 300 illustrated in FIG. 3 . More specifically, S1400 and S1410may be performed by the entropy decoder 310 illustrated in FIG. 3 ,S1420 may be performed by the dequantizer 321 illustrated in FIG. 3 ,S1430 may be performed by the inverse transformer 322, and S1440 may beperformed by the adder 340. Further, the operations according to S1400to S1440 are based on some of the aforementioned descriptions withreference to FIGS. 4 to 11 . Accordingly, detailed descriptions whichoverlap with the aforementioned descriptions in FIGS. 3 to 11 will beomitted or simplified.

As illustrated in FIG. 15 , the decoding apparatus according to anembodiment may include the entropy decoder 310, the dequantizer 321, theinverse transformer 322, and the adder 340. However, in some cases, allof the components illustrated in FIG. 15 may not be essential componentsof the decoding apparatus, and the decoding apparatus may be implementedby more or fewer components than the components illustrated in FIG. 15 .

In the decoding apparatus according to an embodiment, the entropydecoder 310, the dequantizer 321, the inverse transformer 322, and theadder 340 are each implemented as separate chips, or at least twocomponents may also be implemented through a single chip.

The decoding apparatus according to an embodiment may receive abitstream including residual information (S1400). More specifically, theentropy decoder 310 of the decoding apparatus may receive the bitstreamincluding the residual information.

The decoding apparatus according to an embodiment may derive a quantizedtransform coefficient for the current block based on the residualinformation included in the bitstream (S1410). More specifically, theentropy decoder 310 of the decoding apparatus may derive the quantizedtransform coefficient for the current block based on the residualinformation included in the bitstream.

The decoding apparatus according to an embodiment may derive a transformcoefficient from the quantized transform coefficient based on adequantization process (S1420). More specifically, the dequantizer 321of the decoding apparatus may derive the transform coefficient from thequantized transform coefficient based on the dequantization process.

The decoding apparatus according to an embodiment may derive a residualsample for the current block by applying an inverse transform to thederived transform coefficient (S1430). More specifically, the inversetransformer 322 of the decoding apparatus may derive the residual samplefor the current block by applying the inverse transform to the derivedtransform coefficient.

The decoding apparatus according to an embodiment may generate areconstructed picture based on the residual sample for the current block(S1440). More specifically, the adder 340 of the decoding apparatus maygenerate the reconstructed picture based on the residual sample for thecurrent block.

In an embodiment, the residual information includes transformcoefficient level information, and the deriving of the quantizedtransform coefficient may include performing a binarization process forthe transform coefficient level information based on a rice parameter,deriving a value of the transform coefficient level information based onthe result of the binarization process, and deriving the quantizedtransform coefficient based on the value of the transform coefficientlevel information. In an example, the rice parameter may be representedas cRiceParam.

In an embodiment, the maximum value of the rice parameter may be 3. Inan example, the maximum value of the cRiceParam may be 3.

In an embodiment, an initialization process may be performed to deriveat least one rice parameter for the current sub-block included in thecurrent block.

In an embodiment, the rice parameter for the current transformcoefficient within the current sub-block may be derived based on thelast rice parameter for the transform coefficient in the previous orderof the current transform coefficient, and a value of the last riceparameter for the transform coefficient of the previous order may bezero if the current transform coefficient is the first transformcoefficient of the current sub-block. In an example, the last riceparameter may be represented as lastRiceParam. In an example, the sizeof the current sub-block may be 2×2 or 4×4.

In an embodiment, the rice parameter for the current transformcoefficient may be derived based on the neighboring reference transformcoefficients of the current transform coefficient, and the number ofneighboring reference transform coefficients may be 4 or less.

In an embodiment, a temporary sum coefficient may be derived based onthe neighboring reference transform coefficients, a value of the riceparameter may be determined as zero if the value of the temporary sumcoefficient is smaller than a first threshold (for example, th₁), thevalue of the rice parameter may be determined as 1 if the value of thetemporary sum coefficient is the first threshold or more and smallerthan a second threshold (for example, th₂), the value of the riceparameter may be determined as 2 if the value of the temporary sumcoefficient is the second threshold or more and smaller than a thirdthreshold (for example, th₃), and the value of the rice parameter may bedetermined as 3 if the value of the temporary sum coefficient is thethird threshold or more. In an example, the temporary sum coefficientmay be represented as locSumAbs.

In an embodiment, the first threshold may be 1, 2 or 3, the secondthreshold may be 4, 5 or 6, and the third threshold may be 10, 11 or 12.In an example, the first threshold may be represented as th₁, the secondthreshold may be represented as th₂, and the third threshold may berepresented as th₃.

According to the decoding apparatus and an operating method of thedecoding apparatus illustrated in FIGS. 14 and 15 , it is characterizedthat the decoding apparatus receives a bitstream including residualinformation (S1400), derives a quantized transform coefficient for thecurrent block based on the residual information included in thebitstream (S1410), derives a transform coefficient from the quantizedtransform coefficient based on a dequantization process (S1420), andderives a residual sample for the current block by applying an inversetransform to the derived transform coefficient (S1430), and generates areconstructed picture based on the residual sample for the current block(S1440), and the residual information includes transform coefficientlevel information, the deriving of the quantized transform coefficientincludes performing a binarization process for the transform coefficientlevel information based on a rice parameter, deriving a value of thetransform coefficient level information based on the result of thebinarization process, and deriving the quantized transform coefficientbased on the value of the transform coefficient level information, andthe maximum value of the rice parameter is 3. That is, residual codingmay be efficiently performed by setting the maximum value of the riceparameter as 3.

In the aforementioned embodiments, while the methods are described basedon the flowcharts as a series of steps or blocks, the present disclosureis not limited to the order of steps, and a certain step may occur indifferent order from or simultaneously with a step different from thatdescribed above. Further, those skilled in the art will understand thatthe steps shown in the flowchart are not exclusive, and other steps maybe included or one or more steps in the flowcharts may be deletedwithout affecting the scope of the present disclosure.

The aforementioned method according to the present disclosure may beimplemented in the form of software, and the encoding apparatus and/orthe decoding apparatus according to the present disclosure may beincluded in the apparatus for performing image processing of, forexample, a TV, a computer, a smartphone, a set-top box, a displaydevice, and the like.

When the embodiments in the present disclosure are implemented insoftware, the aforementioned method may be implemented as a module(process, function, and the like) for performing the aforementionedfunction. The module may be stored in a memory, and executed by aprocessor. The memory may be located inside or outside the processor,and may be coupled with the processor by various well-known means. Theprocessor may include application-specific integrated circuits (ASICs),other chipsets, logic circuits, and/or data processing devices. Thememory may include a read-only memory (ROM), a random access memory(RAM), a flash memory, a memory card, a storage medium and/or otherstorage devices. That is, the embodiments described in the presentdisclosure may be performed by being implemented on a processor, amicroprocessor, a controller, or a chip. For example, the functionalunits illustrated in each drawing may be performed by being implementedon the computer, the processor, the microprocessor, the controller, orthe chip. In this case, information for implementation (for example,information on instructions) or algorithm may be stored in a digitalstorage medium.

Further, the decoding apparatus and the encoding apparatus to which thepresent disclosure is applied may be included in a multimedia broadcasttransceiver, a mobile communication terminal, a home cinema videodevice, a digital cinema video device, a surveillance camera, a videocommunication device, a real-time communication device such as videocommunication, a mobile streaming device, a storage medium, a camcorder,a Video on Demand (VoD) service provider, an Over the top video (OTTvideo) device, an Internet streaming service provider, athree-dimensional (3D) video device, a virtual reality (VR) device, anaugmented reality (AR) device, a video telephony video device, atransportation terminal (for example, vehicle (including autonomousvehicle), airplane terminal, ship terminal, or the like), and a medicalvideo device, and the like, and may be used to process video signals ordata signals. For example, the Over the top video (OTT video) device mayinclude a game console, a Blu-ray player, an Internet-connected TV, ahome theater system, a smartphone, a tablet PC, a Digital Video Recorder(DVR), and the like.

Further, the processing method to which the present disclosure isapplied may be produced in the form of a program executed by a computer,and may be stored in a computer readable recording medium. Themultimedia data having a data structure according to the presentdisclosure may also be stored in the computer readable recording medium.The computer readable recording medium includes all kinds of storagedevices and distributed storage devices in which computer readable dataare stored. The computer readable recording medium may include, forexample, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, aPROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppydisk, and an optical data storage device. Further, the computer readablerecording medium includes media implemented in the form of a carrierwave (for example, transmission via the Internet). Further, thebitstream generated by the encoding method may be stored in the computerreadable recording medium or transmitted through wired/wirelesscommunication networks.

Further, the embodiments of the present disclosure may be implemented asa computer program product by a program code, and the program code maybe executed on the computer according to the embodiments of the presentdisclosure. The program code may be stored on a computer readablecarrier.

FIG. 16 illustrates an example of a content streaming system to whichthe disclosure disclosed in the present document may be applied.

Referring to FIG. 16 , the content streaming system to which the presentdisclosure is applied may largely include an encoding server, astreaming server, a web server, a media storage, a user device, and amultimedia input device.

The encoding server serves to compact the contents, which are input frommultimedia input devices such as a smartphone, a camera, and a camcorderinto digital data, to generate the bitstream and to transmit thebitstream to the streaming server. As another example, when themultimedia input devices such as a smartphone, a camera, and a camcorderdirectly generate the bitstream, the encoding server may be omitted.

The bitstream may be generated by the encoding method or the bitstreamgenerating method to which the present disclosure is applied, and thestreaming server may temporarily store the bitstream in the process oftransmitting or receiving the bitstream.

The streaming server serves as a medium of transmitting multimedia datato a user device based on a user request through a web server, and theweb server serves as a medium of informing the user of which servicesare available. If the user requests a desired service from the webserver, the web server delivers the request to the streaming server, andthe streaming server transmits multimedia data to the user. At thistime, the content streaming system may include a separate controlserver, and in this case, the control server performs the role ofcontrolling commands/responses between devices within the contentstreaming system.

The streaming server may receive contents from a media storage and/or anencoding server. For example, if contents are received from the encodingserver, the contents may be received in real-time. In this case, toprovide a smooth streaming service, the streaming server may store thebitstream for a certain time.

Examples of the user device may include a mobile phone, a smartphone, alaptop computer, a digital broadcast terminal, a personal digitalassistant (PDA), a portable multimedia player (PMP), a navigationterminal, a slate PC, a tablet PC, an ultrabook, a wearable device (forexample, smart watch, smart glass, or head mounted display (HMD)), adigital TV, a desktop computer, a digital signage, and the like.

Each server within the content streaming system may be operated as adistributed server, and in this case, data received by each server maybe processed in a distributed manner.

1.-15. (canceled)
 16. An image decoding method performed by a decodingapparatus, the method comprising: obtaining residual information from abitstream; deriving a quantized transform coefficient for a currentblock based on the residual information; deriving a transformcoefficient based on the quantized transform coefficient; deriving aresidual sample for the current block based on the transformcoefficient; and generating a reconstructed picture based on theresidual sample for the current block, wherein the residual informationincludes a significant coefficient flag representing whether a quantizedtransform coefficient is a non-zero significant coefficient, a paritylevel flag for a parity of a transform coefficient level for thequantized transform coefficient, a first transform coefficient levelflag about whether the transform coefficient level is larger than afirst reference value, a second transform coefficient level flag aboutwhether the transform coefficient level is larger than a secondreference value and remainder information of the transform coefficientlevel, wherein deriving the quantized transform coefficients comprises:deriving the quantized transform coefficient based on decoding theparity level flag and decoding the first transform coefficient levelflag, and wherein the decoding of the first transform coefficient levelflag is performed prior to the decoding of the parity level flag. 17.The method of claim 16, wherein the sum of the number of significantcoefficient flags for the quantized transform coefficients within thecurrent block, the number of parity level flags, the number of firsttransform coefficient level flags and the number of second transformcoefficient level flags, which are comprised in the residualinformation, is a predetermined threshold or less.
 18. The method ofclaim 17, wherein the predetermined threshold is determined based on thesize of the current block.
 19. The method of claim 16, wherein aninitialization process is performed to derive at least one riceparameter for a current sub-block comprised in the current block. 20.The method of claim 19, wherein the rice parameter for a currenttransform coefficient within the current sub-block is derived based on alast rice parameter for a transform coefficient of a previous order ofthe current transform coefficient, and wherein if the current transformcoefficient is the first transform coefficient of the current sub-block,a value of the last rice parameter for the transform coefficient of theprevious order is zero.
 21. The method of claim 19, wherein the size ofthe current sub-block is 2×2 or 4×4.
 22. The method of claim 20, whereinthe rice parameter for the current transform coefficient is derivedbased on neighboring reference transform coefficients of the currenttransform coefficient, and the number of neighboring reference transformcoefficients is 4 or less.
 23. The method of claim 22, wherein atemporary sum coefficient is derived based on the neighboring referencetransform coefficients, and wherein the value of the rice parameter isdetermined as zero if the value of the temporary sum coefficient issmaller than a first threshold, the value of the rice parameter isdetermined as 1 if the value of the temporary sum coefficient is thefirst threshold or more and smaller than a second threshold, the valueof the rice parameter is determined as 2 if the value of the temporarysum coefficient is the second threshold or more and smaller than a thirdthreshold, and the value of the rice parameter is determined as 3 if thevalue of the temporary sum coefficient is the third threshold or more.24. The method of claim 23, wherein the first threshold is 1, 2, or 3,the second threshold is 4, 5, or 6, and the third threshold is 10, 11,or
 12. 25. An image encoding method performed by an encoding apparatus,the method comprising: deriving a residual sample for a current block;deriving a transform coefficient for the current block based on theresidual sample; deriving a quantized transform coefficient based on thetransform coefficient; and encoding residual information comprisinginformation related to the quantized transform coefficient, wherein theresidual information includes a significant coefficient flagrepresenting whether a quantized transform coefficient is a non-zerosignificant coefficient, a parity level flag for a parity of a transformcoefficient level for the quantized transform coefficient, a firsttransform coefficient level flag about whether the transform coefficientlevel is larger than a first reference value, a second transformcoefficient level flag about whether the transform coefficient level islarger than a second reference value and remainder information of thetransform coefficient level, wherein the encoding of the residualinformation comprises: encoding the parity level flag and encoding thefirst transform coefficient level flag, and wherein the encoding of thefirst transform coefficient level flag is performed prior to theencoding of the parity level flag.
 26. A transmission method of data foran image, the method comprising: obtaining a bitstream for the image,wherein the bitstream is generated based on deriving a residual samplefor a current block, deriving a transform coefficient for the currentblock based on the residual sample, deriving a quantized transformcoefficients based on the transform coefficient, and encoding residualinformation comprising information related to the quantized transformcoefficient; and transmitting the data comprising the bitstream, whereinthe residual information includes a significant coefficient flagrepresenting whether a quantized transform coefficient is a non-zerosignificant coefficient, a parity level flag for a parity of a transformcoefficient level for the quantized transform coefficient, a firsttransform coefficient level flag about whether the transform coefficientlevel is larger than a first reference value, a second transformcoefficient level flag about whether the transform coefficient level islarger than a second reference value and remainder information of thetransform coefficient level, wherein the encoding of the residualinformation comprises: encoding the parity level flag and encoding thefirst transform coefficient level flag, and wherein the encoding of thefirst transform coefficient level flag is performed prior to theencoding of the parity level flag.